API reference

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

N

namespaceTilemap-physics Functions

@codexo/exojs-tilemap-physics / tilemap-physics / stable

Free functions and constants exported from @codexo/exojs-tilemap-physics.

0
props
1
methods
0
events
Overview

Free functions and constants exported from @codexo/exojs-tilemap-physics. Import any of them directly, for example `import { buildObjectLayerColliders } from '@codexo/exojs-tilemap-physics'`.

Functions1
Build one static body per collision object in an object layer and add them to world. An object layer is static data with no residency, so this is a one-shot build with no lifecycle: the caller owns the returned bodies and destroys them through the world. Use import('./TileColliderStreamer').TileColliderStreamer for tile layers, whose chunks come and go. The layer's pixel offset is applied, so the colliders land where the layer is drawn. Objects with no collision geometry (points, tile and text objects) are skipped, as is any object the decomposition rejects - with a warning, not an exception.