mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 07:31:11 +00:00
patch for PixiPatch so render masks again
This commit is contained in:
parent
68d5c73fea
commit
16dc2c1597
1 changed files with 25 additions and 20 deletions
|
@ -134,27 +134,32 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, rend
|
|||
}
|
||||
else if (displayObject instanceof PIXI.FilterBlock)
|
||||
{
|
||||
if (displayObject.open)
|
||||
if(displayObject.data instanceof PIXI.Graphics)
|
||||
{
|
||||
this.context.save();
|
||||
var mask = displayObject.data;
|
||||
|
||||
var cacheAlpha = displayObject.mask.alpha;
|
||||
var maskTransform = displayObject.mask.worldTransform;
|
||||
if(displayObject.open)
|
||||
{
|
||||
this.context.save();
|
||||
|
||||
this.context.setTransform(maskTransform[0], maskTransform[3], maskTransform[1], maskTransform[4], maskTransform[2], maskTransform[5])
|
||||
var cacheAlpha = mask.alpha;
|
||||
var maskTransform = mask.worldTransform;
|
||||
|
||||
displayObject.mask.worldAlpha = 0.5;
|
||||
this.context.setTransform(maskTransform[0], maskTransform[3], maskTransform[1], maskTransform[4], maskTransform[2], maskTransform[5]);
|
||||
|
||||
this.context.worldAlpha = 0;
|
||||
mask.worldAlpha = 0.5;
|
||||
|
||||
PIXI.CanvasGraphics.renderGraphicsMask(displayObject.mask, this.context);
|
||||
this.context.clip();
|
||||
this.context.worldAlpha = 0;
|
||||
|
||||
displayObject.mask.worldAlpha = cacheAlpha;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.context.restore();
|
||||
PIXI.CanvasGraphics.renderGraphicsMask(mask, this.context);
|
||||
this.context.clip();
|
||||
|
||||
mask.worldAlpha = cacheAlpha;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.context.restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
// count++
|
||||
|
|
Loading…
Reference in a new issue