A tilemap created by canvas:tilemap(atlas, opts). Cells index into the atlas; set(x, y, index) places a tile (0-based, bottom-left origin) and get(x, y) returns its index or nil for an empty/out-of-bounds cell. Rows count upward from the bottom — the vertical mirror of Grid's top-left Y-down frame — so copying Grid cells into a tilemap flips the row: ty = rows - 1 - gy.
Set cell (x, y) to atlas index. Raises if the cell is out of bounds (unlike Grid:set, which is a no-op there).
Example
-- Columns count from 0 at the left, rows from 0 at the bottom.-- A cell of the built-in font is its character code minus 32.for x, code inipairs({ string.byte("HELLO", 1, -1) }) do
map:set(x - 1, 3, code - 32)
end