reckfellENGINE

TileSetSource

Exposes a set of tiles for a TileSet resource.

On this page
class TileSetSourceReckfellSharpInherits Resource

Exposes a set of tiles for a TileSet resource.

Exposes a set of tiles for a TileSet resource. Tiles in a source are indexed with two IDs, coordinates ID (of type Vector2i) and an alternative ID (of type int), named according to their use in the TileSetAtlasSource class. Depending on the TileSet source type, those IDs might have restrictions on their values, this is why the base TileSetSource class only exposes getters for them. You can iterate over all tiles exposed by a TileSetSource by first iterating over coordinates IDs using TileSetSource.GetTilesCount and TileSetSource.GetTileId, then over alternative IDs using TileSetSource.GetAlternativeTilesCount and TileSetSource.GetAlternativeTileId. Warning: TileSetSource can only be added to one TileSet at the same time. Calling TileSet.AddSource on a second TileSet will remove the source from the first one.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Methods6

GetAlternativeTileIdint
# GetAlternativeTileId
C#
public int GetAlternativeTileId(Vector2I atlasCoords, int index);

Returns the alternative ID for the tile with coordinates ID atlas_coords at index index.

Parameters
NameTypeDefault
atlasCoordsVector2I—
indexint—
Returns int
GetAlternativeTilesCountint
# GetAlternativeTilesCount
C#
public int GetAlternativeTilesCount(Vector2I atlasCoords);

Returns the number of alternatives tiles for the coordinates ID atlas_coords. For TileSetAtlasSource, this always return at least 1, as the base tile with ID 0 is always part of the alternatives list. Returns -1 if there is not tile at the given coords.

Parameters
NameTypeDefault
atlasCoordsVector2I—
Returns int
GetTileIdVector2I
# GetTileId
C#
public Vector2I GetTileId(int index);

Returns the tile coordinates ID of the tile with index index.

Parameters
NameTypeDefault
indexint—
Returns Vector2I
GetTilesCountint
# GetTilesCount
C#
public int GetTilesCount();

Returns how many tiles this atlas source defines (not including alternative tiles).

Returns int
HasAlternativeTilebool
# HasAlternativeTile
C#
public bool HasAlternativeTile(Vector2I atlasCoords, int alternativeTile);

Returns if the base tile at coordinates atlas_coords has an alternative with ID alternative_tile.

Parameters
NameTypeDefault
atlasCoordsVector2I—
alternativeTileint—
Returns bool
HasTilebool
# HasTile
C#
public bool HasTile(Vector2I atlasCoords);

Returns if this atlas has a tile with coordinates ID atlas_coords.

Parameters
NameTypeDefault
atlasCoordsVector2I—
Returns bool
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.