Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//in the game's preload function you load the image like any other
game.load.image('bkgrnd', 'sprites/background.png');
/*Then you add the tileSprite in create(). This constructor's parameters are, in order:
0 - position of the image on the X coordinate of the game
0 - position of the image on the Y coordinate of the game
640 - Width of the tile
480 - Height of the tile
bkgrnd - key you gave to the image when you loaded it in preload()
see: http://phaser.io/docs/2.4.4/Phaser.TileSprite.html */
game.add.tileSprite(0, 0, 640, 480, 'bkgrnd');
@crowcoder

This comment has been minimized.

Copy link
Owner Author

@crowcoder crowcoder commented Apr 30, 2016

using a tileSprite to act as a background in a Phaser game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment