oobarbazanoo Posted March 28, 2017 Report Share Posted March 28, 2017 How can I change background of the game in Phaser? I am using tileSprite for the bacground and when I destroy current sprite and add new the new one goes at the top of all my game. Quote Link to comment Share on other sites More sharing options...
rhennig Posted March 28, 2017 Report Share Posted March 28, 2017 Create: this.bk = this.add.tileSprite(0,0,this.game.world.width,this.game.world.height,'bkg2'); Change: this.bk.loadTexture('bkg'); Quote Link to comment Share on other sites More sharing options...
oobarbazanoo Posted March 28, 2017 Author Report Share Posted March 28, 2017 9 minutes ago, rhennig said: Create: this.bk = this.add.tileSprite(0,0,this.game.world.width,this.game.world.height,'bkg2'); Change: this.bk.loadTexture('bkg'); Thanks a lot. It helped. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.