Finished off RenderTexture. Sprites can now accept a RenderTexture or a key when you create them. RenderTextures are also now stored in the cache under their own key, making re-using them across other Sprites much easier. Also ported over all of the Tilemap classes, but need to get them rendering.

This commit is contained in:
Richard Davey
2013-09-11 02:57:36 +01:00
parent f885f7b023
commit 48ed27dfcc
11 changed files with 1292 additions and 73 deletions
+7 -2
View File
@@ -22,8 +22,13 @@
function create() {
// var tempSprite = game.add.sprite(game.world.randomX, game.world.randomY, game.rnd.pick(images));
var renderTexture = new Phaser.RenderTexture(800, 600);
var tempSprite = game.add.sprite(0, 0, 'atari1');
tempSprite.visible = false;
var renderTexture = game.add.renderTexture('fuji', 320, 200);
renderTexture.render(tempSprite);
var texturedSprite = game.add.sprite(400, 300, renderTexture);
}