JSFiddle - React, Tailwind, and code Playground
by mulet
HTML
<script src="https://github.com/photonstorm/phaser-ce/releases/download/v2.7.8/phaser.min.js"></script>
JavaScript
cfg = {
width: 400,
height: 100,
renderer: Phaser.WEBGL_MULTI,
antialias: true,
multiTexture: true,
state: {
preload: preload,
create: create,
update: update
}
};
var game = new Phaser.Game(cfg);
function preload() {
game.load.crossOrigin = 'anonymous';
game.load.image('ball', 'https://raw.githubusercontent.com/photonstorm/phaser-examples/master/examples/assets/sprites/pangball.png');
game.load.image('ball2', 'https://raw.githubusercontent.com/photonstorm/phaser-examples/master/examples/assets/sprites/pangball.png');
game.load.image('ball3', 'https://raw.githubusercontent.com/photonstorm/phaser-examples/master/examples/assets/sprites/pangball.png');
game.load.script('BlurX', 'https://cdn.rawgit.com/photonstorm/phaser/master/v2/filters/BlurX.js');
game.load.script('BlurY', 'https://cdn.rawgit.com/photonstorm/phaser/master/v2/filters/BlurY.js');
}
function create() {
game.renderer.setTexturePriority(['ball']);
var sp=game.add.sprite(0, 0, 'ball');
var sp1=game.add.sprite(100, 0, 'ball2');
var sp2 = game.add.sprite(200,0, 'ball3');
var blurX = game.add.filter('BlurX');
var blurY = game.add.filter('BlurY');
blurX.blur = 20;
blurY.blur = 20;
sp2.filters = [blurX, blurY];
}
function update(){}