API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceSampledChunkSourceOptions
@codexo/exojs-tilemap / tilemap / stable
Options for createSampledChunkSource.
0
props
2
methods
0
events
Import
import { SampledChunkSourceOptions } from '@codexo/exojs-tilemap'Options for createSampledChunkSource.
Methods2
mapValueToTile(value: number, tx: number, ty: number): ResolvedTileA fully resolved, format-independent tile reference returned by queries. Materialised on-demand from the packed storage; never stored as a per-cell heap object. | nullConvert a sampled value (and its tile coordinate, for position-dependent logic such as river carving or map edges) into a resolved tile, or null for an empty cell. Must be pure and deterministic, same requirement as sample.
sample(tx: number, ty: number): numberSample a scalar value at a tile coordinate. Called once per tile within each requested chunk. Must be a pure, deterministic function of (tx, ty) - import('./ChunkStreamer').ChunkStreamer regenerates a chunk from scratch via this source whenever it's revisited after eviction, so a non-deterministic sampler would make previously-visited terrain silently change underneath the player.
Source