Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. //in the game's preload function you load the image like any other
  2. game.load.image('bkgrnd', 'sprites/background.png');
  3.  
  4. /*Then you add the tileSprite in create(). This constructor's parameters are, in order:
  5. 0 - position of the image on the X coordinate of the game
  6. 0 - position of the image on the Y coordinate of the game
  7. 640 - Width of the tile
  8. 480 - Height of the tile
  9. bkgrnd - key you gave to the image when you loaded it in preload() */
  10. game.add.tileSprite(0, 0, 640, 480, 'bkgrnd');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement