Method TryGetTile
TryGetTile(int, out TextureRegion?)
Gets the TextureRegion of the tile at the specified index in this Tileset.
public bool TryGetTile(int index, out TextureRegion? tile)
Parameters
index
intThe index of the tile to locate.
tile
TextureRegionWhen this method returns true, contains the TextureRegion of the tile located; otherwise, null.
Returns
- bool
true if a tile was located at the specified index; otherwise, false.
This method returns false if the specified index is less than zero or is greater than or equal to the total number of tiles in this Tileset.
TryGetTile(Point, out TextureRegion?)
Gets the TextureRegion for the tile at the specified column and row in this Tileset.
public bool TryGetTile(Point location, out TextureRegion? tile)
Parameters
location
PointThe column and row location of the tile to locate in this Tileset.
tile
TextureRegionWhen this method returns true, contains the TextureRegion of the tile located; otherwise, null.
Returns
- bool
true if a tile was located at the specified column and row location; otherwise false. This method return false if the column or row in the location specified is less than zero or if either are greater than or equal to the total number of columns or rows in this Tileset.
TryGetTile(int, int, out TextureRegion?)
Gets the TextureRegion for the tile at the specified column and row in this Tileset.
public bool TryGetTile(int column, int row, out TextureRegion? tile)
Parameters
column
intThe column of the tile to locate in this Tileset.
row
intThe row of the tile to locate in this Tileset.
tile
TextureRegionWhen this method returns true, contains the TextureRegion of the tile located; otherwise, null.