-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose GridMapEditorPlugin to scripts and add methods to manipulate t…
…he selection and selected palette item
- Loading branch information
1 parent
0c45ace
commit 6589c81
Showing
4 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="GridMapEditorPlugin" inherits="EditorPlugin" keywords="tilemap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> | ||
<brief_description> | ||
Editor for [GridMap] nodes. | ||
</brief_description> | ||
<description> | ||
GridMapEditorPlugin provides access to the [GridMap] editor functionality. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="get_current_grid_map"> | ||
<return type="GridMap" /> | ||
<description> | ||
Returns the [GridMap] currently edited by the grid map editor. | ||
</description> | ||
</method> | ||
<method name="set_selection"> | ||
<return type="void" /> | ||
<param index="0" name="active" type="bool" /> | ||
<param index="1" name="begin" type="Vector3i" /> | ||
<param index="2" name="end" type="Vector3i" /> | ||
<description> | ||
Set a rectangular selection from [param begin] to [param end]. | ||
Use [code]false[/code] for the [param active] parameter to disable the selection. | ||
</description> | ||
</method> | ||
<method name="get_selection"> | ||
<return type="AABB" /> | ||
<description> | ||
Returns the cell coordinate bounds of the current selection. Use [method is_selection_active] to check if there is an active selection. | ||
</description> | ||
</method> | ||
<method name="is_selection_active"> | ||
<return type="bool" /> | ||
<description> | ||
Returns [code]true[/code] if the selection is currently active. | ||
</description> | ||
</method> | ||
<method name="get_selected_cells"> | ||
<return type="Array" /> | ||
<description> | ||
Returns an array of [Vector3i]s with the selected cells' coordinates. | ||
</description> | ||
</method> | ||
<method name="set_selected_palette_item"> | ||
<return type="int" /> | ||
<param index="0" name="item" type="int" /> | ||
<description> | ||
Selects the [MeshLibrary] item with the given index in the grid map editor's palette. If a negative index is given, no item will be selected. If a value greater than the last index is given, the last item will be selected. | ||
Note: the indices may not be in the same order as appear in the editor's interface. | ||
</description> | ||
</method> | ||
<method name="get_selected_palette_item"> | ||
<return type="int" /> | ||
<description> | ||
Returns the index of the selected [MeshLibrary] item in the grid map editor's palette or [code]-1[/code] if no item is selected. | ||
Note: the indices may not be in the same order as appear in the editor's interface. | ||
</description> | ||
</method> | ||
</methods> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters