diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 76d8f1840f51..fd52a2848649 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -90,9 +90,10 @@
-
+
+ Returns the local position corresponding to the given tilemap (grid-based) coordinates.
@@ -107,6 +108,7 @@
+ Sets the tile index for the cell given by a Vector2i.
@@ -137,6 +139,7 @@
+ Emitted when the [TileSet] of this TileMap changes.
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index 13c6b9070afd..ff68a017a1df 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -298,12 +298,15 @@
+ Orthogonal orientation mode.
+ Isometric orientation mode.
+ Hexagon orientation mode.
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 44001984979b..0afead0863b5 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -902,7 +902,7 @@ void TileMap::_get_property_list(List *p_list) const {
p_list->push_back(p);
}
-Vector2 TileMap::map_to_world(const Vector2 &p_pos) const {
+Vector2 TileMap::map_to_world(const Vector2i &p_pos) const {
// SHOULD RETURN THE CENTER OF THE TILE
ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2());
@@ -980,7 +980,7 @@ Vector2 TileMap::map_to_world(const Vector2 &p_pos) const {
}
Vector2i TileMap::world_to_map(const Vector2 &p_pos) const {
- ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2());
+ ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2i());
Vector2 ret = p_pos;
ret /= tile_set->get_tile_size();
@@ -1143,7 +1143,7 @@ Vector2i TileMap::world_to_map(const Vector2 &p_pos) const {
} else {
ret = (ret + Vector2(0.00005, 0.00005)).floor();
}
- return ret;
+ return Vector2i(ret);
}
bool TileMap::is_existing_neighbor(TileSet::CellNeighbor p_cell_neighbor) const {
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index 704897da1587..e9dbccbdb913 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -264,7 +264,7 @@ class TileMap : public Node2D {
void update_dirty_quadrants();
- Vector2 map_to_world(const Vector2 &p_pos) const;
+ Vector2 map_to_world(const Vector2i &p_pos) const;
Vector2i world_to_map(const Vector2 &p_pos) const;
bool is_existing_neighbor(TileSet::CellNeighbor p_cell_neighbor) const;