EditorBridge
Defined in: context.ts:20
Surface the engine exposes to an attached editor host.
registerComponent is called eagerly during defineComponent so the
editor knows the full component catalogue. The on* callbacks are all
optional — an editor that only needs the catalogue (no live inspector)
can leave them unset and avoid any per-mutation overhead.
All entity values are the engine’s numeric Entity handle. Component
identification is by the string name that was passed to
registerComponent / defineComponent.
Methods
Section titled “Methods”onComponentAdded()?
Section titled “onComponentAdded()?”
optionalonComponentAdded(entity,component):void
Defined in: context.ts:30
Fired when a component is first attached to an entity.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”string
Returns
Section titled “Returns”void
onComponentChanged()?
Section titled “onComponentChanged()?”
optionalonComponentChanged(entity,component):void
Defined in: context.ts:36
Fired when component data changes (insert with new data, set, or edit).
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”string
Returns
Section titled “Returns”void
onComponentRemoved()?
Section titled “onComponentRemoved()?”
optionalonComponentRemoved(entity,component):void
Defined in: context.ts:33
Fired when a component is detached from an entity.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”string
Returns
Section titled “Returns”void
onEntityDespawned()?
Section titled “onEntityDespawned()?”
optionalonEntityDespawned(entity):void
Defined in: context.ts:27
Fired just before an entity is destroyed. Components are still attached.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
onEntitySpawned()?
Section titled “onEntitySpawned()?”
optionalonEntitySpawned(entity,name?):void
Defined in: context.ts:24
Fired after an entity is created (optionally with a Name component).
Parameters
Section titled “Parameters”entity
Section titled “entity”number
string
Returns
Section titled “Returns”void
onParentChanged()?
Section titled “onParentChanged()?”
optionalonParentChanged(child,parent):void
Defined in: context.ts:39
Fired when a parent link changes. parent === null means the entity was unparented.
Parameters
Section titled “Parameters”number
parent
Section titled “parent”number | null
Returns
Section titled “Returns”void
registerComponent()
Section titled “registerComponent()”registerComponent(
name,defaults,isTag):void
Defined in: context.ts:21
Parameters
Section titled “Parameters”string
defaults
Section titled “defaults”Record<string, unknown>
boolean
Returns
Section titled “Returns”void