mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +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,29 +134,34 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, rend
|
|||
}
|
||||
else if (displayObject instanceof PIXI.FilterBlock)
|
||||
{
|
||||
if(displayObject.data instanceof PIXI.Graphics)
|
||||
{
|
||||
var mask = displayObject.data;
|
||||
|
||||
if(displayObject.open)
|
||||
{
|
||||
this.context.save();
|
||||
|
||||
var cacheAlpha = displayObject.mask.alpha;
|
||||
var maskTransform = displayObject.mask.worldTransform;
|
||||
var cacheAlpha = mask.alpha;
|
||||
var maskTransform = mask.worldTransform;
|
||||
|
||||
this.context.setTransform(maskTransform[0], maskTransform[3], maskTransform[1], maskTransform[4], maskTransform[2], maskTransform[5])
|
||||
this.context.setTransform(maskTransform[0], maskTransform[3], maskTransform[1], maskTransform[4], maskTransform[2], maskTransform[5]);
|
||||
|
||||
displayObject.mask.worldAlpha = 0.5;
|
||||
mask.worldAlpha = 0.5;
|
||||
|
||||
this.context.worldAlpha = 0;
|
||||
|
||||
PIXI.CanvasGraphics.renderGraphicsMask(displayObject.mask, this.context);
|
||||
PIXI.CanvasGraphics.renderGraphicsMask(mask, this.context);
|
||||
this.context.clip();
|
||||
|
||||
displayObject.mask.worldAlpha = cacheAlpha;
|
||||
mask.worldAlpha = cacheAlpha;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.context.restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
// count++
|
||||
displayObject = displayObject._iNext;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue