mirror of
https://github.com/wassname/phaser.git
synced 2026-07-07 00:06:37 +08:00
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:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user