The 2D layer · interface

Tilemap

Explained in Sprites and tilemaps.

interface Tilemap
import type { Tilemap } from '@driftengine/ui2d';

Properties

NameTypeDescription
columnsreadonlynumber
rowsreadonlynumber
tilesreadonlyInt32ArrayOne frame index per cell, row-major. TILE_EMPTY for a cell with nothing in it.
tileWidthreadonlynumberHow big a cell is, in whatever units the batch's affine maps from.
tileHeightreadonlynumber
xnumberWhere cell (0, 0)'s corner sits.
More

Mutable, because scrolling a map is moving it and the alternative is rebuilding one.

ynumber