Class TileLayer
- Namespace
- DotTiled
- Assembly
- DotTiled.dll
Represents a tile layer in a map.
public class TileLayer : BaseLayer, IHasProperties
- Inheritance
-
TileLayer
- Implements
- Inherited Members
Properties
Data
The tile layer data.
public Optional<Data> Data { get; set; }
Property Value
Height
The height of the layer in tiles. Always the same as the map height for fixed-size maps.
public required int Height { get; set; }
Property Value
Width
The width of the layer in tiles. Always the same as the map width for fixed-size maps.
public required int Width { get; set; }
Property Value
X
The X coordinate of the layer in tiles.
public int X { get; set; }
Property Value
Y
The Y coordinate of the layer in tiles.
public int Y { get; set; }
Property Value
Methods
GetGlobalTileIDAtCoord(int, int)
Helper method to retrieve the Global Tile ID at a given coordinate in the layer. Will work for infinite maps with chunks as well.
public uint GetGlobalTileIDAtCoord(int x, int y)
Parameters
Returns
- uint
The Global Tile ID at the given coordinate, or 0 for infinite maps where the specified coordinate is not in any chunk.
Exceptions
- InvalidOperationException
Thrown when either Data or GlobalTileIDs are missing values.
- ArgumentException
Thrown when the given coordinate is not within bounds of the layer.