Skip to content

Components

TileMap

A room painted in tiles, as one node instead of thousands of pieces: a tile asset for the art, square, isometric or hexagonal cells sized to the world, and collision generated from whichever layers are marked solid.

On this page

Add it

+ Add node → Tilemap creates a node with it already on. Already have a node for it? Add component → TileMapComponent.

From a script

A script on the same node writes these fields by name. TileMapComponent is the name to pass.

rgs
set_point("TileMapComponent", "tile_size", vec2(16.0, 16.0));
set_colour("TileMapComponent", "color", vec4(1.0, 1.0, 1.0, 1.0));
set_flag("TileMapComponent", "collision", true);

Fields

FieldScript nameKindDefaultWhat it does
TilemaptilemapassetnoneThe .tilemap asset this node draws.
Tile Sizetile_sizetwo numbers (x, y), at least 0.01(16, 16)One tile's size in world units.
Gridgridone of Rectangle, Isometric, IsometricStaggered, HexPointyTop, HexFlatTopRectangleSquare, isometric or hexagonal cells.
Colorcolorcolour#ffffffTint applied to every tile.
Sort Layerlayernumber0Lower draws first.
CollisioncollisioncheckboxonTurn layers marked solid into collision shapes.