API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classTilemapOccluder

@codexo/exojs-lighting / lighting / stable

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.

0
props
1
methods
0
events
Import
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.

Constructors1
Methods1
Append the segments overlapping bounds to out. Called once per frame with the region the visible lights actually reach, so a source that can narrow its search by region should. Reporting more than bounds covers is allowed and only costs work; reporting less than it covers leaks light. bounds is valid for the duration of the call and is reused afterwards.
Source