Jump to content

How to add background in Phaser?


Recommended Posts

You would probably want to use a TileSprite for this, and either use autoScroll to make it move continually, or if you want more control, subtract from the tilePosition.x property in the update function. See this fiddle:




You will need to use Phaser.CANVAS as the rendering mode with this image as it is - if you want to use AUTO and allow webGL (which is highly recommended) you will need to change the size of your image so that both the width and height are powers of 2 - in this case I'd say the image would need to be 1024 pixels wide by 256 pixels high.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...