BitmapData.drawGroupProxy is now capable of iterating through Sprites that have children, and also now uses the world positions for drawing instead.

This commit is contained in:
photonstorm 2016-05-11 16:38:42 +01:00
parent 74af2079b6
commit 1d18c70371

View file

@ -1470,17 +1470,22 @@ Phaser.BitmapData.prototype = {
*/
drawGroupProxy: function (child, blendMode, roundPx) {
if (child.type === Phaser.EMITTER || child.type === Phaser.BITMAPTEXT)
// Draw base Object
if (child.hasOwnProperty('texture'))
{
this.copy(child, null, null, null, null, child.worldPosition.x, child.worldPosition.y, null, null, child.worldRotation, null, null, child.worldScale.x, child.worldScale.y, child.worldAlpha, blendMode, roundPx);
}
if (child.hasOwnProperty('children') && child.children.length > 0)
{
var c;
for (var i = 0; i < child.children.length; i++)
{
this.copy(child.children[i], null, null, null, null, null, null, null, null, null, null, null, null, null, null, blendMode, roundPx);
c = child.children[i];
this.copy(c, null, null, null, null, c.worldPosition.x, c.worldPosition.y, null, null, c.worldRotation, null, null, c.worldScale.x, c.worldScale.y, child.worldAlpha, blendMode, roundPx);
}
}
else
{
this.copy(child, null, null, null, null, null, null, null, null, null, null, null, null, null, null, blendMode, roundPx);
}
},