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
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Tilemap | tilemap | asset | none | The .tilemap asset this node draws. |
| Tile Size | tile_size | two numbers (x, y), at least 0.01 | (16, 16) | One tile's size in world units. |
| Grid | grid | one of Rectangle, Isometric, IsometricStaggered, HexPointyTop, HexFlatTop | Rectangle | Square, isometric or hexagonal cells. |
| Color | color | colour | #ffffff | Tint applied to every tile. |
| Sort Layer | layer | number | 0 | Lower draws first. |
| Collision | collision | checkbox | on | Turn layers marked solid into collision shapes. |