oobarbazanoo Posted March 28, 2017 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. Link to comment Share on other sites More sharing options...
rhennig Posted March 28, 2017 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'); Link to comment Share on other sites More sharing options...
oobarbazanoo Posted March 28, 2017 Author 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. Link to comment Share on other sites More sharing options...
Recommended Posts