From d7f51dd2ec60f5c237e471b65e890c11f172b24b Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 24 Jan 2022 13:59:24 +0100 Subject: [PATCH] Better clarify map_to_world() description --- doc/classes/TileMap.xml | 3 ++- scene/2d/tile_map.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index e37031f3fd5..07b95438233 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -202,7 +202,8 @@ - Returns the local position corresponding to the given tilemap (grid-based) coordinates. + 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. diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 5857b6710f9..25c83b0c8f7 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -2725,7 +2725,7 @@ void TileMap::_get_property_list(List *p_list) const { } Vector2 TileMap::map_to_world(const Vector2i &p_pos) const { - // SHOULD RETURN THE CENTER OF THE TILE + // SHOULD RETURN THE CENTER OF THE CELL ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2()); Vector2 ret = p_pos;