alflashy Posted March 28, 2018 Share Posted March 28, 2018 Hi I have loaded sprite in loop and hidden all of them. I want to show them one by one on click actions How can i get each sprite by key id and show one at time for (var i = 1; i < 4; i++){ var personSelection = this.add.sprite(game.world.centerX, game.world.centerY, 'bw'+i); personSelection.anchor.set(0.5) personSelection.inputEnabled = true; personSelection.input.useHandCursor = true; personSelection.events.onInputDown.add(this.startScene, this); personSelection.visible = false; console.log(personSelection) } Link to comment Share on other sites More sharing options...
Recommended Posts