mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
Handle child masking. Fix #5354
This commit is contained in:
parent
0fad1861ae
commit
b96e15f2ec
1 changed files with 31 additions and 3 deletions
|
@ -67,11 +67,39 @@ var SpineContainerWebGLRenderer = function (renderer, container, camera, parentM
|
|||
|
||||
for (var i = 0; i < children.length; i++)
|
||||
{
|
||||
var src = children[i];
|
||||
var child = children[i];
|
||||
|
||||
if (src.willRender(camera))
|
||||
if (child.willRender(camera))
|
||||
{
|
||||
src.renderWebGL(renderer, src, camera, transformMatrix, container);
|
||||
var mask = child.mask;
|
||||
|
||||
if (mask)
|
||||
{
|
||||
sceneRenderer.end();
|
||||
|
||||
renderer.pipelines.rebind();
|
||||
|
||||
mask.preRenderWebGL(renderer, child, camera);
|
||||
|
||||
renderer.pipelines.clear();
|
||||
|
||||
sceneRenderer.begin();
|
||||
}
|
||||
|
||||
child.renderWebGL(renderer, child, camera, transformMatrix, container);
|
||||
|
||||
if (mask)
|
||||
{
|
||||
sceneRenderer.end();
|
||||
|
||||
renderer.pipelines.rebind();
|
||||
|
||||
mask.postRenderWebGL(renderer, camera);
|
||||
|
||||
renderer.pipelines.clear();
|
||||
|
||||
sceneRenderer.begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue