API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classMapObjectSpawner
Turns the objects authored in a map into game objects. A spawner owns its own dispatch table, so several games, tests, editor previews or mods can run in one process without seeing each other's factories. There is no global registry to register into and nothing to reset between tests. ExoJS owns the mechanism: identity, ordering, cancellation, rollback and lifetime. The game owns the policy: which object becomes what, and what those objects need - dependencies travel through `Context`, not through any service locator in the engine. A spawn is **atomic**: if any factory fails, everything already created is destroyed in reverse order and no session is produced.
import { MapObjectSpawner } from '@codexo/exojs-tilemap'Turns the objects authored in a map into game objects.
A spawner owns its own dispatch table, so several games, tests, editor previews or mods can run in one process without seeing each other's factories. There is no global registry to register into and nothing to reset between tests.
ExoJS owns the mechanism: identity, ordering, cancellation, rollback and lifetime. The game owns the policy: which object becomes what, and what those objects need - dependencies travel through `Context`, not through any service locator in the engine.
A spawn is **atomic**: if any factory fails, everything already created is destroyed in reverse order and no session is produced.
new(factories: MapObjectFactoriesDispatch key to factory. Keys are matched against the spawner's `identify` result.<Context, Result>, options?: MapObjectSpawnerOptionsOptions for MapObjectSpawner.<Context>): MapObjectSpawner<Context, Result>handles(key: string): booleanspawn(map: TileMapA generic, format-independent tile map. Owns a finite grid of TileLayers and a shared set of TileSets. Tile data is stored in compact chunked arrays - no per-t…, context: Context, options?: MapSpawnOptionsOptions for MapObjectSpawner.spawn.): Promise<MapSpawnSessionThe objects one spawn produced, and their shared lifetime. A session is handed out by import('./MapObjectSpawner').MapObjectSpawner.spawn and owns every result…<Result>>