Kallystan Posted November 20, 2016 Share Posted November 20, 2016 Hello, I am new to using Phaser for small games and I try to put the shader Pixelate. I do not know how to put it and when I look at the example, this one does not even work. I tried to copy the code from another shader, but this one is different. What should I do ? Link to comment Share on other sites More sharing options...
FlashyGoblin Posted February 24, 2017 Share Posted February 24, 2017 I ran into the same issue. I got it working in my game by doing the following. Be sure to include the Pixelate.js after you load phaser.js. (https://github.com/photonstorm/phaser/blob/master/v2/filters/Pixelate.js) With that loaded, now you can use the filter. var pixelate = this.game.add.filter('Pixelate', this.game.width, this.game.height); pixelate.sizeX = pixelate.sizeY = 4; var sprite = this.game.add.sprite(); sprite.width = this.game.width; sprite.height = this.game.height; sprite.filters = [ pixelate ]; Link to comment Share on other sites More sharing options...
Recommended Posts