Jump to content

Filter not working.


Heppell08
 Share

Recommended Posts

I have been in the examples and done pretty much a copy and paste of the code into my menu state code to use the filter. I've still not got anything coming onscreen and i console logged the update of the filter which returns undefined even though its all named correctly as you'll see in the below code.

 

If anyone knows why the filter is not working let me know.

Neonizer.Menu = function(game) {}; var backdrop; var startButton; var optionsButton; var creditButton; var text; var gridGroup; var gridLine; var filter; var blankdrop; var menuBoom;Neonizer.Menu.prototype = {	    create: function()    {    	backdrop = this.add.sprite(0,0,'menuBD');    	backdrop.width = 800;    	backdrop.height = 600;        blankdrop = this.add.sprite(0,0);        blankdrop.width = 800;        blankdrop.height = 600;        filter = this.add.filter('LightBeam', 800, 600);        //  You have the following values to play with (defaults shown):        filter.alpha = 0.0;        // filter.red = 1.0;        // filter.green = 1.0;        // filter.blue = 2.0;        // filter.thickness = 70.0;        filter.speed = 1.5;        blankdrop.filters = [filter];        startButton = this.add.button(this.game.world.centerX - 300, this.game.world.centerY - 200, 'startBtn', this.startGame, this, 0);        startButton.events.onInputOver.add(this.buttonScale, this);        startButton.events.onInputOut.add(this.buttonScaleDown, this);        menuBoom = this.add.emitter(0,0,100);        menuBoom.makeParticles('menuSpark');    },    update: function()    {        filter.update();                menuBoom.x = this.input.activePointer.x;        menuBoom.y = this.input.activePointer.y;        menuBoom.start(true, 2000, null, 1);	    },    startGame: function()    {        this.game.state.start('Game');    },    buttonScale: function()    {        startButton.scale.x = 1.3;        startButton.scale.y = 1.3;    },    buttonScaleDown: function()    {        startButton.scale.x = 1;        startButton.scale.y = 1;    },};
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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