mirror of
https://github.com/photonstorm/phaser
synced 2024-12-19 01:24:48 +00:00
6f5d4b93b8
In the demo (code below), i create a group with a rect mask, and create a sprite as child with a blurXY filter, then nothing is displayed. So i hack WebGLFilterManager's pushFilter and popFilter method, in pushFilter method i create a new stencilManager instance and cache the old one, in popFilter i destroy the new stencilManager and restore the old one, then this workaround works rightly as i expect. I think this is bug for PIXI, so i hope @GoodBoyDigital and @photonstorm can help me to check whether this fixing is right or not, thanks. 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('filterX', '../filters/BlurX.js'); game.load.script('filterY', '../filters/BlurY.js'); } function create() { var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser'); logo.anchor.setTo(0.5, 0.5); var blurX = game.add.filter('BlurX'); var blurY = game.add.filter('BlurY'); logo.filters = [blurX, blurY]; var group = game.add.group(); group.addChild(logo); group.mask = game.add.graphics(); group.mask.beginFill(0xff); group.mask.drawRect(0,0,500,500); } |
||
---|---|---|
.. | ||
display | ||
extras | ||
filters | ||
primitives | ||
renderers | ||
text | ||
textures | ||
utils | ||
Intro.js | ||
Outro.js | ||
Pixi.js |