New Fire filter.

This commit is contained in:
photonstorm
2013-11-21 12:34:41 +00:00
parent b286093093
commit 7d7aa795e7
4 changed files with 177 additions and 8 deletions
+34
View File
@@ -0,0 +1,34 @@
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
var background;
var filter;
function preload() {
game.load.image('phaser', 'assets/sprites/phaser2.png');
}
function create() {
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
logo.anchor.setTo(0.5, 0.5);
background = game.add.sprite(0, 0);
background.width = 800;
background.height = 600;
filter = game.add.filter('Fire', 800, 600);
filter.alpha = 0.0;
background.filters = [filter];
}
function update() {
filter.update();
}