summaryrefslogtreecommitdiff
path: root/doc/classes/TileMap.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/TileMap.xml')
-rw-r--r--doc/classes/TileMap.xml37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index d7108c3a2a..4ac5718e04 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" />
@@ -187,6 +204,17 @@
- The alternative tile identifier [code]alternative_tile[/code] identifies a tile alternative the source is a [TileSetAtlasSource], and the scene for a [TileSetScenesCollectionSource].
</description>
</method>
+ <method name="set_cells_from_surrounding_terrains">
+ <return type="void" />
+ <argument index="0" name="layer" type="int" />
+ <argument index="1" name="cells" type="Vector2i[]" />
+ <argument index="2" name="terrain_set" type="int" />
+ <argument index="3" name="ignore_empty_terrains" type="bool" default="true" />
+ <description>
+ Updates all the cells in the [code]cells[/code] coordinates array and replace them by tiles that matches the surrounding cells terrains. Only cells form the given [code]terrain_set[/code] are considered.
+ If [code]ignore_empty_terrains[/code] is true, zones with no terrain defined are ignored to select the tiles.
+ </description>
+ </method>
<method name="set_layer_enabled">
<return type="void" />
<argument index="0" name="layer" type="int" />
@@ -237,6 +265,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" />