Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Redot.
Checking the stable version of the documentation...
TileMapPatternΒΆ
Inherits: Resource < RefCounted < Object
Holds a pattern to be copied from or pasted into TileMaps.
DescriptionΒΆ
This resource holds a set of cells to help bulk manipulations of TileMap.
A pattern always start at the (0,0)
coordinates and cannot have cells with negative coordinates.
MethodsΒΆ
get_cell_alternative_tile(coords: Vector2i) const |
|
get_cell_atlas_coords(coords: Vector2i) const |
|
get_cell_source_id(coords: Vector2i) const |
|
get_size() const |
|
get_used_cells() const |
|
is_empty() const |
|
void |
remove_cell(coords: Vector2i, update_size: bool) |
void |
set_cell(coords: Vector2i, source_id: int = -1, atlas_coords: Vector2i = Vector2i(-1, -1), alternative_tile: int = -1) |
void |
Method DescriptionsΒΆ
int get_cell_alternative_tile(coords: Vector2i) const π
Returns the tile alternative ID of the cell at coords
.
Vector2i get_cell_atlas_coords(coords: Vector2i) const π
Returns the tile atlas coordinates ID of the cell at coords
.
int get_cell_source_id(coords: Vector2i) const π
Returns the tile source ID of the cell at coords
.
Vector2i get_size() const π
Returns the size, in cells, of the pattern.
Array[Vector2i] get_used_cells() const π
Returns the list of used cell coordinates in the pattern.
bool has_cell(coords: Vector2i) const π
Returns whether the pattern has a tile at the given coordinates.
Returns whether the pattern is empty or not.
void remove_cell(coords: Vector2i, update_size: bool) π
Remove the cell at the given coordinates.
void set_cell(coords: Vector2i, source_id: int = -1, atlas_coords: Vector2i = Vector2i(-1, -1), alternative_tile: int = -1) π
Sets the tile identifiers for the cell at coordinates coords
. See TileMap.set_cell.
void set_size(size: Vector2i) π
Sets the size of the pattern.