TileMapPattern
Holds a pattern to be copied from or pasted into TileMaps.
Holds a pattern to be copied from or pasted into TileMaps.
This resource holds a set of cells to help bulk manipulations of TileMap.
A pattern always starts at the (0, 0) coordinates and cannot have cells with negative coordinates.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
TileMapPatternConstructor
public TileMapPattern();Methods10
GetCellAlternativeTileint
public int GetCellAlternativeTile(Vector2I coords);Returns the tile alternative ID of the cell at coords.
| Name | Type | Default |
|---|---|---|
coords | Vector2I | — |
intGetCellAtlasCoordsVector2I
public Vector2I GetCellAtlasCoords(Vector2I coords);Returns the tile atlas coordinates ID of the cell at coords.
| Name | Type | Default |
|---|---|---|
coords | Vector2I | — |
Vector2IGetCellSourceIdint
public int GetCellSourceId(Vector2I coords);Returns the tile source ID of the cell at coords.
| Name | Type | Default |
|---|---|---|
coords | Vector2I | — |
intGetSizeVector2I
public Vector2I GetSize();Returns the size, in cells, of the pattern.
Vector2IGetUsedCellsReckfell.Collections.Array<Vector2I>
public Reckfell.Collections.Array<Vector2I> GetUsedCells();Returns the list of used cell coordinates in the pattern.
Reckfell.Collections.Array<Vector2I>HasCellbool
public bool HasCell(Vector2I coords);Returns whether the pattern has a tile at the given coordinates.
| Name | Type | Default |
|---|---|---|
coords | Vector2I | — |
boolIsEmptybool
public bool IsEmpty();Returns whether the pattern is empty or not.
boolRemoveCellvoid
public void RemoveCell(Vector2I coords, bool updateSize);Remove the cell at the given coordinates.
| Name | Type | Default |
|---|---|---|
coords | Vector2I | — |
updateSize | bool | — |
SetCellvoid
public void SetCell(Vector2I coords, int sourceId = -1, Vector2I? atlasCoords = default, int alternativeTile = -1);Sets the tile identifiers for the cell at coordinates coords. See TileMap.SetCell.
| Name | Type | Default |
|---|---|---|
coords | Vector2I | — |
sourceId | int | -1 |
atlasCoords | Vector2I? | default |
alternativeTile | int | -1 |
atlasCoordsIf the parameter is null, then the default value is new Vector2I(-1, -1).
SetSizevoid
public void SetSize(Vector2I size);Sets the size of the pattern.
| Name | Type | Default |
|---|---|---|
size | Vector2I | — |