godot-tilemaplayer

Installation
SKILL.md

TileMapLayer (Godot 4.3+)

Godot 4.3 added the TileMapLayer node and deprecated TileMap. Each TileMapLayer is one layer, so a level with ground, walls and decoration is three sibling TileMapLayer nodes sharing one TileSet. Do not write new code against TileMap, and never use the Godot 3 API (set_cellv, world_to_map, set_cell(x, y, tile_id)).

The cell API

A cell is identified by integer map coordinates (Vector2i). A tile is identified by three values:

  • source_id: the ID of a source in the TileSet (an atlas texture or a scenes collection). The first atlas is usually 0; check the TileSet editor or the return value of TileSet.add_source().
  • atlas_coords: the tile's column and row inside that atlas, in tiles, not pixels.
  • alternative_tile: 0 unless you made flipped or rotated alternatives.
extends TileMapLayer

const SOURCE_ID := 0
const GRASS := Vector2i(0, 0)
const WALL := Vector2i(1, 0)
Installs
7
First Seen
5 days ago