adriantxu Posted April 27, 2017 Share Posted April 27, 2017 I'm new with Phaser, and I dont know if its posible to get a specific tileSprite object by its key. I got this: this.add.tileSprite(0, 0, 800, 600, 'background'); is there something like: var bg = this.get.tileSprite('background'); Thanks a lot. Link to comment Share on other sites More sharing options...
RubbleGames Posted April 28, 2017 Share Posted April 28, 2017 Have you tried just storing your tilesprite in a variable as you crate it: var bg = this.add.tileSprite(0, 0, 800, 600, 'background'); Link to comment Share on other sites More sharing options...
adriantxu Posted May 2, 2017 Author Share Posted May 2, 2017 On 28/4/2017 at 5:13 PM, RubbleGames said: Have you tried just storing your tilesprite in a variable as you crate it: var bg = this.add.tileSprite(0, 0, 800, 600, 'background'); Yeah that worked! Thank you. But isn't there a native way of doing it? What if I have to access from another state/class? It forces me to create another global variable. Link to comment Share on other sites More sharing options...
Recommended Posts