Search the Community
Showing results for tags 'Tileset Tilemap Sprite'.
Found 1 result
Creating a sprite from a Tilemap's tilesetI have a tilemap that's working fine. What I want to do is to create a Sprite that can be based on the same tileset as the tilemap uses so I can create dynamic tiles. I've extracted some of my code from some objects below to make what I'm effectively doing at the moment a bit clearer. var map = game.add.tilemap(mapId);map.addTilesetImage(tilesetName, imageId);var carriedTile = new Phaser.Sprite(game, 100, 64, imageId);game.add.existing(carriedTile);What I get, as expected, is a Sprite that displays the entire tileset image. What I need to do is to get a Sprite that only displays one tile from the Tileset. How do I achieve that? I've tried setting the textureRegion, but that doesn't seem to do anything. Thanks.