diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/TileMap.xml | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index e76c696021..54eb83297d 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -207,6 +207,13 @@ Returns if a layer Y-sorts its tiles. </description> </method> + <method name="local_to_map" qualifiers="const"> + <return type="Vector2i" /> + <param index="0" name="local_position" type="Vector2" /> + <description> + Returns the map coordinates of the cell containing the given [param local_position]. If [param local_position] is in global coordinates, consider using [method Node2D.to_local] before passing it to this method. See also [method map_to_local]. + </description> + </method> <method name="map_pattern"> <return type="Vector2i" /> <param index="0" name="position_in_tilemap" type="Vector2i" /> @@ -216,12 +223,12 @@ Returns for the given coordinate [param coords_in_pattern] in a [TileMapPattern] the corresponding cell coordinates if the pattern was pasted at the [param position_in_tilemap] 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"> + <method name="map_to_local" qualifiers="const"> <return type="Vector2" /> <param index="0" name="map_position" type="Vector2i" /> <description> - Returns a local position of the center of the cell at the given tilemap (grid-based) coordinates. - [b]Note:[/b] This doesn't correspond to the visual position of the tile, i.e. it ignores the [member TileData.texture_offset] property of individual tiles. + Returns the centered position of a cell in the TileMap's local coordinate space. To convert the returned value into global coordinates, use [method Node2D.to_global]. See also [method local_to_map]. + [b]Note:[/b] This may not correspond to the visual position of the tile, i.e. it ignores the [member TileData.texture_offset] property of individual tiles. </description> </method> <method name="move_layer"> @@ -344,13 +351,6 @@ Paste the given [TileMapPattern] at the given [param position] and [param layer] in the tile map. </description> </method> - <method name="world_to_map" qualifiers="const"> - <return type="Vector2i" /> - <param index="0" name="world_position" type="Vector2" /> - <description> - Returns the tilemap (grid-based) coordinates corresponding to the given local position. - </description> - </method> </methods> <members> <member name="cell_quadrant_size" type="int" setter="set_quadrant_size" getter="get_quadrant_size" default="16"> |