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.xml39
1 files changed, 31 insertions, 8 deletions
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 80a6458cec..d532f583e6 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="TileMap" inherits="Node2D" version="4.0">
+<class name="TileMap" inherits="Node2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Node for 2D tile-based maps.
</brief_description>
@@ -57,6 +57,14 @@
Clears all cells on the given layer.
</description>
</method>
+ <method name="erase_cell">
+ <return type="void" />
+ <argument index="0" name="layer" type="int" />
+ <argument index="1" name="coords" type="Vector2i" />
+ <description>
+ Erases the cell on layer [code]layer[/code] at coordinates [code]coords[/code].
+ </description>
+ </method>
<method name="fix_invalid_tiles">
<return type="void" />
<description>
@@ -227,7 +235,7 @@
<argument index="1" name="coords" type="Vector2i" />
<argument index="2" name="source_id" type="int" default="-1" />
<argument index="3" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" />
- <argument index="4" name="alternative_tile" type="int" default="-1" />
+ <argument index="4" name="alternative_tile" type="int" default="0" />
<description>
Sets the tile indentifiers for the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. Each tile of the [TileSet] is identified using three parts:
- The source identifier [code]source_id[/code] identifies a [TileSetSource] identifier. See [method TileSet.set_source_id],
@@ -235,15 +243,30 @@
- 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">
+ <method name="set_cells_terrain_connect">
<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" />
+ <argument index="3" name="terrain" type="int" />
+ <argument index="4" name="ignore_empty_terrains" type="bool" default="true" />
+ <description>
+ Update all the cells in the [code]cells[/code] coordinates array so that they use the given [code]terrain[/code] for the given [code]terrain_set[/code]. If an updated cell has the same terrain as one of its neighboring cells, this function tries to join the two. This function might update neighboring tiles if needed to create correct terrain transitions. If [code]ignore_empty_terrains[/code] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
+ If [code]ignore_empty_terrains[/code] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
+ [b]Note:[/b] To work correctly, [code]set_cells_terrain_connect[/code] requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results.
+ </description>
+ </method>
+ <method name="set_cells_terrain_path">
+ <return type="void" />
+ <argument index="0" name="layer" type="int" />
+ <argument index="1" name="path" type="Vector2i[]" />
+ <argument index="2" name="terrain_set" type="int" />
+ <argument index="3" name="terrain" type="int" />
+ <argument index="4" 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.
+ Update all the cells in the [code]cells[/code] coordinates array so that they use the given [code]terrain[/code] for the given [code]terrain_set[/code]. The function will also connect two successive cell in the path with the same terrain. This function might update neighboring tiles if needed to create correct terrain transitions.
+ If [code]ignore_empty_terrains[/code] is true, empty terrains will be ignored when trying to find the best fitting tile for the given terrain constraints.
+ [b]Note:[/b] To work correctly, [code]set_cells_terrain_path[/code] requires the TileMap's TileSet to have terrains set up with all required terrain combinations. Otherwise, it may produce unexpected results.
</description>
</method>
<method name="set_layer_enabled">
@@ -322,10 +345,10 @@
[b]Note:[/b] Enabling [code]collision_animatable[/code] may have a small performance impact, only do it if the TileMap is moving and has colliding tiles.
</member>
<member name="collision_visibility_mode" type="int" setter="set_collision_visibility_mode" getter="get_collision_visibility_mode" enum="TileMap.VisibilityMode" default="0">
- Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show collision debug settings.
+ Show or hide the TileMap's collision shapes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show collision debug settings.
</member>
<member name="navigation_visibility_mode" type="int" setter="set_navigation_visibility_mode" getter="get_navigation_visibility_mode" enum="TileMap.VisibilityMode" default="0">
- Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show navigation debug settings.
+ Show or hide the TileMap's collision shapes. If set to [constant VISIBILITY_MODE_DEFAULT], this depends on the show navigation debug settings.
</member>
<member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset">
The assigned [TileSet].