API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classTilemapOccluder
Shadows from the occupied cells of a tile layer. ```ts lighting.occludeFrom(new TilemapOccluder(tilemap.layer('walls'))); ``` Only the boundary between occupied and empty cells is emitted, and runs of it are merged, so a corridor costs a handful of segments rather than one per tile. Outlines are cached per block of cells and rebuilt when the layer's revision changes, which is what lets a streamed map bring its shadows in with its chunks. Every tile in the layer blocks light unless `solid` says otherwise, which suits a layer dedicated to walls.
import { TilemapOccluder } from '@codexo/exojs-lighting'Shadows from the occupied cells of a tile layer.
```ts lighting.occludeFrom(new TilemapOccluder(tilemap.layer('walls'))); ```
Only the boundary between occupied and empty cells is emitted, and runs of it are merged, so a corridor costs a handful of segments rather than one per tile. Outlines are cached per block of cells and rebuilt when the layer's revision changes, which is what lets a streamed map bring its shadows in with its chunks.
Every tile in the layer blocks light unless `solid` says otherwise, which suits a layer dedicated to walls.
new(layer: OccluderTileLayerWhat TilemapOccluder needs of a tile layer: its cell metrics, a way to walk the cells of a region, and a revision that changes when the cells do. Structural on…<Tile>, options: TilemapOccluderOptionsTuning for TilemapOccluder.<Tile>): TilemapOccluder<Tile>collect(bounds: ReadonlyRectangleRead-only view of a Rectangle: every accessor and non-mutating query a rectangle offers, with none of its writers. Returned by APIs that hand out a LIVE intern…, out: OccluderSinkWhere an OccluderSource writes what blocks light. The main channel is line segments in world space: an occluder has no thickness, no interior and no material,…): void