From 1d18c703710116880de65f17d3c6d00aca797e24 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Wed, 11 May 2016 16:38:42 +0100 Subject: [PATCH] BitmapData.drawGroupProxy is now capable of iterating through Sprites that have children, and also now uses the world positions for drawing instead. --- src/gameobjects/BitmapData.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gameobjects/BitmapData.js b/src/gameobjects/BitmapData.js index afab87349..00f4660b6 100644 --- a/src/gameobjects/BitmapData.js +++ b/src/gameobjects/BitmapData.js @@ -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); - } },