1681-engine / index / AutotileRule
Interface: AutotileRule ​
Defined in: src/tilemap/autotile.ts:114
How one terrain picks its tiles.
Properties ​
connectsTo? ​
optional connectsTo?: readonly number[];Defined in: src/tilemap/autotile.ts:129
Other terrain ids this one joins as if they were its own (a road meeting a bridge).
fallback? ​
optional fallback?: number;Defined in: src/tilemap/autotile.ts:127
The tile when the table has no entry for a mask (default: the entry for the full mask, else empty).
mode? ​
optional mode?: AutotileMode;Defined in: src/tilemap/autotile.ts:118
Which mask picks the tile (default 'blob').
terrain ​
terrain: number;Defined in: src/tilemap/autotile.ts:116
The terrain id this rule draws.
tiles ​
tiles:
| Readonly<Record<number, number | readonly number[]>>
| ((mask, x, y) => number);Defined in: src/tilemap/autotile.ts:125
The tile for a mask: a table by mask (a list picks one of several by the cell's position, the same every time), or a function of the mask (and the cell, for anything fancier). Blob masks are the reduced ones; to lay a 47-tile set out in BLOB47_MASKS order use (m) => first + blob47Index(m). Edge masks run 0…15, so a 16-tile strip in mask order is (m) => first + m.