mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
Pixi GrayFilter ported over (thanks nickryall #404)
Fixed Time.totalElapsedSeconds, which gets the other filters working again too.
This commit is contained in:
@@ -252,6 +252,10 @@
|
||||
"file": "fire.js",
|
||||
"title": "fire"
|
||||
},
|
||||
{
|
||||
"file": "gray.js",
|
||||
"title": "gray"
|
||||
},
|
||||
{
|
||||
"file": "lightbeams.js",
|
||||
"title": "lightbeams"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
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];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user