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 Godot.
Checking the stable version of the documentation...
TileMapPattern
繼承: Resource < RefCounted < Object
存放 TileMap 的圖案,用於複製貼上。
說明
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.
方法
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 |
方法說明
int get_cell_alternative_tile(coords: Vector2i) const 🔗
返回位於 coords 的儲存格的備選圖塊 ID。
Vector2i get_cell_atlas_coords(coords: Vector2i) const 🔗
返回位於 coords 的儲存格的圖塊合集座標 ID。
int get_cell_source_id(coords: Vector2i) const 🔗
返回位於 coords 的儲存格的圖塊源 ID。
返回該圖案的大小(單位為儲存格)。
Array[Vector2i] get_used_cells() const 🔗
返回該圖案中使用的儲存格座標列表。
bool has_cell(coords: Vector2i) 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) 🔗
設定位於 coords 的儲存格的圖塊識別字。見 TileMap.set_cell()。
void set_size(size: Vector2i) 🔗
設定圖案的大小。