mirror of
https://github.com/wassname/phaser.git
synced 2026-07-25 13:20:14 +08:00
Caustics filter
This commit is contained in:
@@ -194,6 +194,10 @@
|
||||
"file": "lightbeams.js",
|
||||
"title": "lightbeams"
|
||||
},
|
||||
{
|
||||
"file": "marble.js",
|
||||
"title": "marble"
|
||||
},
|
||||
{
|
||||
"file": "plasma.js",
|
||||
"title": "plasma"
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create, update: update });
|
||||
|
||||
var background;
|
||||
var filter;
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('phaser', 'assets/sprites/phaser2.png');
|
||||
game.load.script('filter', '../filters/Marble.js');
|
||||
|
||||
}
|
||||
|
||||
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('Marble', 800, 600);
|
||||
//filter.alpha = 0.0;
|
||||
|
||||
background.filters = [filter];
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
filter.update();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user