Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

TileMap

Inherits: Node2D < CanvasItem < Node < Object

Node for 2D tile-based maps.

Description

Node for 2D tile-based maps. Tilemaps use a TileSet which contain a list of tiles which are used to create grid-based maps. A TileMap may have several layers, layouting tiles on top of each other.

For performance reasons, all TileMap updates are batched at the end of a frame. Notably, this means that scene tiles from a TileSetScenesCollectionSource may be initialized after their parent.

To force an update earlier on, call update_internals.

Tutorials

Properties

bool

collision_animatable

false

VisibilityMode

collision_visibility_mode

0

VisibilityMode

navigation_visibility_mode

0

int

rendering_quadrant_size

16

TileSet

tile_set

Methods

void

_tile_data_runtime_update ( int layer, Vector2i coords, TileData tile_data ) virtual

bool

_use_tile_data_runtime_update ( int layer, Vector2i coords ) virtual

void

add_layer ( int to_position )

void

clear ( )

void

clear_layer ( int layer )

void

erase_cell ( int layer, Vector2i coords )

void

fix_invalid_tiles ( )

void

force_update ( int layer=-1 )

int

get_cell_alternative_tile ( int layer, Vector2i coords, bool use_proxies=false ) const

Vector2i

get_cell_atlas_coords ( int layer, Vector2i coords, bool use_proxies=false ) const

int

get_cell_source_id ( int layer, Vector2i coords, bool use_proxies=false ) const

TileData

get_cell_tile_data ( int layer, Vector2i coords, bool use_proxies=false ) const

Vector2i

get_coords_for_body_rid ( RID body )

int

get_layer_for_body_rid ( RID body )

Color

get_layer_modulate ( int layer ) const

String

get_layer_name ( int layer ) const

RID

get_layer_navigation_map ( int layer ) const

int

get_layer_y_sort_origin (