Jump to content

how to use pixi filters.


nak3ddogs
 Share

Recommended Posts

hi! 
how can i use pixi filter?

 

it wont work for me:

        this.grayFilter = new PIXI.GrayFilter();
        this.aluljaro.filter = [this.grayFilter];

i got this in console:Uncaught TypeError: undefined is not a function

i thinked pixi have implemented pixi

 

can i apply blur on the whole game?

 

ty for any advice

 

Link to comment
Share on other sites

var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create });function preload() {    game.load.image('phaser', 'assets/sprites/phaser2.png');    game.load.script('gray', '../filters/Gray.js');}function create() {  var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');  logo.anchor.setTo(0.5, 0.5);  var gray = game.add.filter('Gray');  logo.filters = [gray];}

You'll find Gray.js in the filters folder in the Phaser repository.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...