valueerror Posted February 10, 2015 Share Posted February 10, 2015 hello fellow phaser lovers.. i'm just giving filters a shot and i need to "gray-out" some elements .. the first task was very easy thx to the examples on examples.phaser.io but now i wonder if it is possible to configure those filters for example it would be nice to desaturate my images but not completely.. unfortunately i can't make any sense out of the code inside gray.jsalso setting the grade of the blur would be nice.. it is definitely to muche blurred right now.. thx in advance for any tips on how to accomplish this Link to comment Share on other sites More sharing options...
valueerror Posted February 10, 2015 Author Share Posted February 10, 2015 well.. i figured it out for anyone who wants to add a gray filter (desaturate) to his game... here is the how to.. preload: (get gray.js from phaser git repo)game.load.script('gray', 'Gray.js');create:grayfilter = game.add.filter('Gray');grayfilter.gray = 0.6; // this sets the amount of de-saturation (1 is full)stageGroup.filters = [gray]; // apply filter to something nicloay and BigRob154 2 Link to comment Share on other sites More sharing options...
valueerror Posted February 10, 2015 Author Share Posted February 10, 2015 the only question that remains is why do i need to import gray.js - why can't i just do something like: grayfilter = new PIXI.GrayFilter();you have to know.. i am able to use other things from here http://docs.phaser.io/PIXI.html like new PIXI.RenderTexture or new PIXI.Matrix so i am a little bit (or very much) confused Link to comment Share on other sites More sharing options...
Recommended Posts