dgoemans Posted February 19, 2014 Share Posted February 19, 2014 Hi all, I'm looking to optimize our game by rendering chunks of our game grid offscreen and only redrawing them when something inside them animates/dies. The way i do it at the moment is as follows: Creating the render texture and adding it to a group: var renderTexture = game.add.renderTexture(name, width, height);var renderSprite = new phaser.Sprite(game, x, y, renderTexture);renderSprite.parent = undefined;var index = parent.getIndex(replaceChild);parent.addAt(renderSprite, index);return renderSprite;And rendering it:target.renderXY(object, object.x, object.y, clear);Note that I have to set the renderSprite's parent to undefined, otherwise Phaser 1.1.5 crashes trying to disconnect the sprite from its current parent. This was not an issue in 1.1.4. However, on Android stock browser ( note, not the Galaxy S4 which uses a Chromium fork ), it just refuses to render anything. Any ideas on this? Thanks in advance,David Goemans Link to comment Share on other sites More sharing options...
Recommended Posts