mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 09:48:18 +00:00
Container can how set a pipeline that overrides all children
This commit is contained in:
parent
ce69c22e86
commit
bf7e7f352a
1 changed files with 13 additions and 5 deletions
|
@ -22,8 +22,9 @@
|
|||
var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix)
|
||||
{
|
||||
var children = container.list;
|
||||
var childCount = children.length;
|
||||
|
||||
if (children.length === 0)
|
||||
if (childCount === 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -51,14 +52,16 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix
|
|||
renderer.setBlendMode(0);
|
||||
}
|
||||
|
||||
if (container.forcePipeline)
|
||||
{
|
||||
renderer.pipelines.lock(container.pipeline, container);
|
||||
}
|
||||
|
||||
var alpha = container.alpha;
|
||||
|
||||
var scrollFactorX = container.scrollFactorX;
|
||||
var scrollFactorY = container.scrollFactorY;
|
||||
|
||||
var list = children;
|
||||
var childCount = children.length;
|
||||
|
||||
for (var i = 0; i < childCount; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
|
@ -114,7 +117,7 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix
|
|||
renderer.currentType = type;
|
||||
}
|
||||
|
||||
renderer.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === renderer.currentType) : false;
|
||||
renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false;
|
||||
|
||||
// Set parent values
|
||||
child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);
|
||||
|
@ -137,6 +140,11 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix
|
|||
|
||||
renderer.newType = false;
|
||||
}
|
||||
|
||||
if (container.forcePipeline)
|
||||
{
|
||||
renderer.pipelines.unlock();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = ContainerWebGLRenderer;
|
||||
|
|
Loading…
Reference in a new issue