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
indexintThe index of the tile to locate.
tileTextureRegionWhen 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
locationPointThe column and row location of the tile to locate in this Tileset.
tileTextureRegionWhen 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
columnintThe column of the tile to locate in this Tileset.
rowintThe row of the tile to locate in this Tileset.
tileTextureRegionWhen this method returns true, contains the TextureRegion of the tile located; otherwise, null.