TileMapPattern
继承: Resource
< RefCounted
< Object
Holds a pattern to be copied from or pasted into TileMap
s.
描述
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.
方法
int | get_cell_alternative_tile ( coords: Vector2i ) const1 |
Vector2i | get_cell_atlas_coords ( coords: Vector2i ) const1 |
int | get_cell_source_id ( coords: Vector2i ) const1 |
Vector2i | get_size ( ) const1 |
Array Vector2i | get_used_cells ( ) const1 |
bool | has_cell ( coords: Vector2i ) const1 |
bool | is_empty ( ) const1 |
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 | set_size ( size: Vector2i ) |
方法说明
int
get_cell_alternative_tile ( coords: Vector2i
) const1
Returns the tile alternative ID of the cell at coords
.
Vector2i
get_cell_atlas_coords ( coords: Vector2i
) const1
Returns the tile atlas coordinates ID of the cell at coords
.
int
get_cell_source_id ( coords: Vector2i
) const1
Returns the tile source ID of the cell at coords
.
Returns the size, in cells, of the pattern.
Array Vector2i
get_used_cells ( ) const1
Returns the list of used cell coordinates in the pattern.
bool
has_cell ( coords: Vector2i
) const1
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.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。