Table of Contents

Method TryGetTile

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

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 int

The index of the tile to locate.

tile TextureRegion

When 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 Point

The column and row location of the tile to locate in this Tileset.

tile TextureRegion

When 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 int

The column of the tile to locate in this Tileset.

row int

The row of the tile to locate in this Tileset.

tile TextureRegion

When 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; 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.