diff options
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/Control.xml | 6 | ||||
-rw-r--r-- | doc/classes/TileMap.xml | 26 | ||||
-rw-r--r-- | doc/classes/TileMapPattern.xml | 85 | ||||
-rw-r--r-- | doc/classes/TileSet.xml | 28 |
4 files changed, 142 insertions, 3 deletions
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 7c8239977f..332d171457 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -763,10 +763,10 @@ </method> <method name="set_drag_forwarding"> <return type="void" /> - <argument index="0" name="target" type="Node" /> + <argument index="0" name="target" type="Object" /> <description> - Forwards the handling of this control's drag and drop to [code]target[/code] node. - Forwarding can be implemented in the target node similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences: + Forwards the handling of this control's drag and drop to [code]target[/code] object. + Forwarding can be implemented in the target object similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences: 1. The function name must be suffixed with [b]_fw[/b] 2. The function must take an extra argument that is the control doing the forwarding [codeblocks] diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index d7108c3a2a..e65d5b4533 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -117,6 +117,14 @@ Returns the neighboring cell to the one at coordinates [code]coords[/code], indentified by the [code]neighbor[/code] direction. This method takes into account the different layouts a TileMap can take. </description> </method> + <method name="get_pattern"> + <return type="TileMapPattern" /> + <argument index="0" name="layer" type="int" /> + <argument index="1" name="coords_array" type="Vector2i[]" /> + <description> + Creates a new [TileMapPattern] from the given layer and set of cells. + </description> + </method> <method name="get_surrounding_tiles"> <return type="Vector2i[]" /> <argument index="0" name="coords" type="Vector2i" /> @@ -151,6 +159,15 @@ Returns if a layer Y-sorts its tiles. </description> </method> + <method name="map_pattern"> + <return type="Vector2i" /> + <argument index="0" name="position_in_tilemap" type="Vector2i" /> + <argument index="1" name="coords_in_pattern" type="Vector2i" /> + <argument index="2" name="pattern" type="TileMapPattern" /> + <description> + Returns for the given coodinate [code]coords_in_pattern[/code] in a [TileMapPattern] the corresponding cell coordinates if the pattern was pasted at the [code]position_in_tilemap[/code] coordinates (see [method set_pattern]). This mapping is required as in half-offset tile shapes, the mapping might not work by calculating [code]position_in_tile_map + coords_in_pattern[/code] + </description> + </method> <method name="map_to_world" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="map_position" type="Vector2i" /> @@ -237,6 +254,15 @@ Sets a layers Z-index value. This Z-index is added to each tile's Z-index value. </description> </method> + <method name="set_pattern"> + <return type="void" /> + <argument index="0" name="layer" type="int" /> + <argument index="1" name="position" type="Vector2i" /> + <argument index="2" name="pattern" type="TileMapPattern" /> + <description> + Paste the given [TileMapPattern] at the given [code]position[/code] and [code]layer[/code] in the tile map. + </description> + </method> <method name="world_to_map" qualifiers="const"> <return type="Vector2i" /> <argument index="0" name="world_position" type="Vector2" /> diff --git a/doc/classes/TileMapPattern.xml b/doc/classes/TileMapPattern.xml new file mode 100644 index 0000000000..4c46625423 --- /dev/null +++ b/doc/classes/TileMapPattern.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="TileMapPattern" inherits="Resource" version="4.0"> + <brief_description> + Holds a pattern to be copied from or pasted into [TileMap]s. + </brief_description> + <description> + This resource holds a set of cells to help bulk manipulations of [TileMap]. + A pattern always start at the [code](0,0)[/code] coordinates and cannot have cells with negative coordinates. + </description> + <tutorials> + </tutorials> + <methods> + <method name="get_cell_alternative_tile" qualifiers="const"> + <return type="int" /> + <argument index="0" name="coords" type="Vector2i" /> + <description> + Returns the tile alternative ID of the cell at [code]coords[/code]. + </description> + </method> + <method name="get_cell_atlas_coords" qualifiers="const"> + <return type="Vector2i" /> + <argument index="0" name="coords" type="Vector2i" /> + <description> + Returns the tile atlas coordinates ID of the cell at [code]coords[/code]. + </description> + </method> + <method name="get_cell_source_id" qualifiers="const"> + <return type="int" /> + <argument index="0" name="coords" type="Vector2i" /> + <description> + Returns the tile source ID of the cell at [code]coords[/code]. + </description> + </method> + <method name="get_size" qualifiers="const"> + <return type="Vector2i" /> + <description> + Returns the size, in cells, of the pattern. + </description> + </method> + <method name="get_used_cells" qualifiers="const"> + <return type="Vector2i[]" /> + <description> + Returns the list of used cell coordinates in the pattern. + </description> + </method> + <method name="has_cell" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="coords" type="Vector2i" /> + <description> + Returns whether the pattern has a tile at the given coordinates. + </description> + </method> + <method name="is_empty" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the pattern is empty or not. + </description> + </method> + <method name="remove_cell"> + <return type="void" /> + <argument index="0" name="coords" type="Vector2i" /> + <argument index="1" name="arg1" type="bool" /> + <description> + Remove the cell at the given coordinates. + </description> + </method> + <method name="set_cell"> + <return type="void" /> + <argument index="0" name="coords" type="Vector2i" /> + <argument index="1" name="source_id" type="int" default="-1" /> + <argument index="2" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" /> + <argument index="3" name="alternative_tile" type="int" default="-1" /> + <description> + Sets the tile indentifiers for the cell at coordinates [code]coords[/code]. See [method TileMap.set_cell]. + </description> + </method> + <method name="set_size"> + <return type="void" /> + <argument index="0" name="size" type="Vector2i" /> + <description> + Sets the size of the pattern. + </description> + </method> + </methods> +</class> diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 02baded019..45d6f9ca6c 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -46,6 +46,14 @@ Occlusion layers allow assigning occlusion polygons to atlas tiles. </description> </method> + <method name="add_pattern"> + <return type="int" /> + <argument index="0" name="pattern" type="TileMapPattern" /> + <argument index="1" name="index" type="int" default="-1" /> + <description> + Adds a [TileMapPattern] to be stored in the TileSet resouce. If provided, insert it at the given [code]index[/code]. + </description> + </method> <method name="add_physics_layer"> <return type="void" /> <argument index="0" name="to_position" type="int" default="-1" /> @@ -154,6 +162,19 @@ Returns the occlusion layers count. </description> </method> + <method name="get_pattern"> + <return type="TileMapPattern" /> + <argument index="0" name="index" type="int" default="-1" /> + <description> + Returns the [TileMapPattern] at the given [code]index[/code]. + </description> + </method> + <method name="get_patterns_count"> + <return type="int" /> + <description> + Returns the number of [TileMapPattern] this tile set handles. + </description> + </method> <method name="get_physics_layer_collision_layer" qualifiers="const"> <return type="int" /> <argument index="0" name="layer_index" type="int" /> @@ -374,6 +395,13 @@ Removes the occlusion layer at index [code]layer_index[/code]. Also updates the atlas tiles accordingly. </description> </method> + <method name="remove_pattern"> + <return type="void" /> + <argument index="0" name="index" type="int" /> + <description> + Remove the [TileMapPattern] at the given index. + </description> + </method> <method name="remove_physics_layer"> <return type="void" /> <argument index="0" name="layer_index" type="int" /> |