mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
Particle Emitters and Containers can now have geometry masked children
This commit is contained in:
parent
1fc9b15ff1
commit
78e1ef9df0
2 changed files with 12 additions and 1 deletions
|
@ -75,6 +75,11 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent
|
|||
renderer.setBlendMode(child.blendMode);
|
||||
}
|
||||
|
||||
if (child.mask)
|
||||
{
|
||||
child.mask.preRenderWebGL(renderer, child, camera);
|
||||
}
|
||||
|
||||
// Set parent values
|
||||
child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);
|
||||
child.setAlpha(childAlpha * alpha);
|
||||
|
@ -85,6 +90,11 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent
|
|||
// Restore original values
|
||||
child.setAlpha(childAlpha);
|
||||
child.setScrollFactor(childScrollFactorX, childScrollFactorY);
|
||||
|
||||
if (child.mask)
|
||||
{
|
||||
child.mask.postRenderWebGL(renderer, camera);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -144,7 +144,8 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola
|
|||
|
||||
if (emitter.mask)
|
||||
{
|
||||
emitter.mask.postRenderWebGL(renderer);
|
||||
emitter.mask.postRenderWebGL(renderer, camera);
|
||||
pipeline.setTexture2D(texture, 0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue