Last active
April 30, 2016 22:38
-
-
Save crowcoder/ae5ce413f44dcdc1b3accabbd91851d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using a tileSprite to act as a background in a Phaser game.