API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classLdtkProject
A loaded LDtk project, prepared for streaming: world layout and tileset atlases are resident, level payloads are not. This is the entry point for a game that loads levels as it needs them. Read worlds to decide what to load, then drive a MapWorldRuntime from createRuntime to load and unload individual levels, each with its own asset scope. What is eager, and why: - the `.ldtk` document itself, because the world layout is what the game navigates by; - every tileset atlas. This is a prefetch policy, not a technical requirement, and it is bounded: LDtk declares tilesets once per project (`defs.tilesets`), never per level, so the count does not grow with the number of levels. Paying for them once keeps a level load off the network entirely for a non-externalized project, and off the *image* network for an externalized one. The atlases are claimed by this asset's own scope, so their residency is tied to how long the `ldtkProject` asset is held - not to a MapWorldRuntime. Releasing the asset releases them; destroying a runtime does not. What is lazy: - external `.ldtkl` level payloads - fetched when the level loads, claimed by that level's scope, released when it unloads; - the conversion of a level into a runtime `TileMap`; - anything the level's import('@codexo/exojs-tilemap').MapObjectSpawner creates. Load the whole project at once with the `ldtkMap` asset type instead (import('./LdtkMap').LdtkMap) when a game is small enough not to need any of this.
import { LdtkProject } from '@codexo/exojs-ldtk'A loaded LDtk project, prepared for streaming: world layout and tileset atlases are resident, level payloads are not.
This is the entry point for a game that loads levels as it needs them. Read worlds to decide what to load, then drive a MapWorldRuntime from createRuntime to load and unload individual levels, each with its own asset scope.
What is eager, and why:
- the `.ldtk` document itself, because the world layout is what the game navigates by; - every tileset atlas. This is a prefetch policy, not a technical requirement, and it is bounded: LDtk declares tilesets once per project (`defs.tilesets`), never per level, so the count does not grow with the number of levels. Paying for them once keeps a level load off the network entirely for a non-externalized project, and off the *image* network for an externalized one.
The atlases are claimed by this asset's own scope, so their residency is tied to how long the `ldtkProject` asset is held - not to a MapWorldRuntime. Releasing the asset releases them; destroying a runtime does not.
What is lazy:
- external `.ldtkl` level payloads - fetched when the level loads, claimed by that level's scope, released when it unloads; - the conversion of a level into a runtime `TileMap`; - anything the level's import('@codexo/exojs-tilemap').MapObjectSpawner creates.
Load the whole project at once with the `ldtkMap` asset type instead (import('./LdtkMap').LdtkMap) when a game is small enough not to need any of this.
source: string