API reference

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

C

classMapObjectSpawner

@codexo/exojs-tilemap / tilemap / stable

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.

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

Constructors1
Methods2
handles(key: string): boolean
Whether a factory is registered under key.
Create a game object for every object of map a factory matches, and return the MapSpawnSession that owns them. Objects are visited in object-layer order, then object order within each layer, and asynchronous factories are awaited in that same order - a factory that resolves early can never overtake one before it.
Properties1
What to do with an object no factory matched.
Source