mirror of
https://github.com/wassname/phaser.git
synced 2026-06-29 16:30:29 +08:00
Filters fixed to work with Pixi 1.5.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
|
||||
// var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update });
|
||||
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('knightHawks', 'assets/fonts/KNIGHT3.png');
|
||||
game.load.script('filter', '../filters/Plasma.js');
|
||||
|
||||
}
|
||||
|
||||
var font;
|
||||
var i;
|
||||
var background;
|
||||
var filter;
|
||||
|
||||
function create() {
|
||||
|
||||
background = game.add.sprite(0, 0);
|
||||
background.width = 800;
|
||||
background.height = 600;
|
||||
|
||||
filter = game.add.filter('Plasma', 800, 600);
|
||||
|
||||
background.filters = [filter];
|
||||
|
||||
font = game.add.bitmapFont('knightHawks', 31, 25, Phaser.BitmapFont.TEXT_SET6, 10, 1, 1);
|
||||
font.text = 'phaser was here';
|
||||
|
||||
i = game.add.image(0, 0, font);
|
||||
|
||||
// sprite = game.add.tileSprite(0, 0, 800, 600, font);
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
filter.update();
|
||||
|
||||
// Uncomment for coolness :)
|
||||
// filter.blueShift -= 0.001;
|
||||
|
||||
|
||||
// font.text = "phaser x: " + game.input.x + " y: " + game.input.y;
|
||||
|
||||
}
|
||||
@@ -35,6 +35,13 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) {
|
||||
*/
|
||||
this.passes = [this];
|
||||
|
||||
/**
|
||||
* @property shaders
|
||||
* @type Array an array of shaders
|
||||
* @private
|
||||
*/
|
||||
this.shaders = [];
|
||||
|
||||
/**
|
||||
* @property {boolean} dirty - Internal PIXI var.
|
||||
* @default
|
||||
|
||||
Reference in New Issue
Block a user