stwe Posted March 25, 2016 Share Posted March 25, 2016 suppose, I have a TileMap and a Button which opens a popup Menu by click. My popup menu is a sprite (game.add.sprite) which holds some sprites (some Ships) as Child: popup.addChild(shipArray); My Tilemap is loading by: map = game.add.tilemap('Map'); map.addTilesetImage('terrain_atlas', 'terrain_atlas'); background = map.createLayer('Background'); background.resizeWorld(); How do I get the sprite from the popup menu on the tilemap? I have tried the following. // Sprite in the popup menu is clicked function isShipButtonDown(sprite, pointer) { popup.removeChild(sprite); sprite.x = 912; // example positions sprite.y = 1264; } But the sprite is then no longer visible. Link to comment Share on other sites More sharing options...
stwe Posted March 25, 2016 Author Share Posted March 25, 2016 Answer to my own question: game.add.existing(sprite); Link to comment Share on other sites More sharing options...
Recommended Posts