GridMapEditorPlugin
继承: EditorPlugin < Node < Object
GridMap 节点的编辑器。
描述
GridMapEditorPlugin 提供对 GridMap 编辑器功能的访问。
方法
void |
|
get_current_grid_map() const |
|
get_selected_cells() const |
|
get_selected_palette_item() const |
|
get_selection() const |
|
has_selection() const |
|
void |
set_selected_palette_item(item: int) const |
void |
set_selection(begin: Vector3i, end: Vector3i) |
方法说明
void clear_selection() 🔗
取消选择当前选中的单元格。
GridMap get_current_grid_map() const 🔗
返回网格地图编辑器当前编辑的 GridMap 节点。
Array get_selected_cells() const 🔗
返回 Vector3i 数组,表示选中单元格的坐标。
int get_selected_palette_item() const 🔗
返回网格地图编辑器调色板中选中的 MeshLibrary 项目的索引号,未选中项目时返回 -1。
注意:索引可能与编辑器界面中展示的顺序不一致。
返回当前选中项的单元格坐标边界。请使用 has_selection() 检查是否存在选中项。
如果存在选中的单元格,则返回 true。
void set_selected_palette_item(item: int) const 🔗
选中网格地图编辑器调色板中索引号对应的 MeshLibrary 项目。如果给定的索引为负数,则不选中任何项目。如果给定值超过最后一个索引,则选中最后一个项目。
注意:索引可能与编辑器界面中展示的顺序不一致。
void set_selection(begin: Vector3i, end: Vector3i) 🔗
选中从 begin 到 end 范围内的单元格。