Click or drag to resize

TileMapMapToWorld Method

Returns the local position of the top left corner of the cell corresponding to the given tilemap (grid-based) coordinates.

To get the global position, use ToGlobal(Vector2):

var local_position = my_tilemap.map_to_world(map_position)
var global_position = my_tilemap.to_global(local_position)

Optionally, the tilemap's half offset can be ignored.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Vector2 MapToWorld(
	Vector2 mapPosition,
	bool ignoreHalfOfs = false
)

Parameters

mapPosition
Type: GodotVector2

[Missing <param name="mapPosition"/> documentation for "M:Godot.TileMap.MapToWorld(Godot.Vector2,System.Boolean)"]

ignoreHalfOfs (Optional)
Type: SystemBoolean

[Missing <param name="ignoreHalfOfs"/> documentation for "M:Godot.TileMap.MapToWorld(Godot.Vector2,System.Boolean)"]

Return Value

Type: Vector2

[Missing <returns> documentation for "M:Godot.TileMap.MapToWorld(Godot.Vector2,System.Boolean)"]

See Also