Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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() */
- game.add.tileSprite(0, 0, 640, 480, 'bkgrnd');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement