NamedTileOrderedIndexes
Introduction
The NameTileOrderedIndexes property can be used to find tiles by a given name. It is a Dictionary<string, List<int>> , where the key is a name, and the value is the index of tiles which have the given name.
Tile Ordered Indexes
The MapDrawableBatch object stores a list of vertices (points) which are used to define the coordinates for each tile. These points are used by the rendering code in the MapDrawableBatch class to perform efficient rendering. Each tile is composed of a list of vertices, as opposed to a Sprite (as might be the case if the MapDrawableBatch were a FlatRedBall-drawn object). Therefore, to access and modify properties on a tile, its index must be known. The following image shows the indexes of a simple tile map:
Code Example
The following code example shows how to create an Entity for every tile with the name "CreateEntity".
Setting the Name in Tiled
Tiles will only have properties at runtime if it uses a tile in a tileset with a Name property.
Last updated