Saltar al contenido principal

events

DescripciĆ³nā€‹

This library includes functions that handle event management.

Propiedadesā€‹

PropiedadDescripciĆ³n
globalIdUsed to dispatch/listen for events globally.

Funcionesā€‹

addListenerā€‹

Registers a component to listen to an event.

world.events.addListener(target: eid, name: string, listener: function) -> void

removeListenerā€‹

Un-registers an existing listener

world.events.removeListener(target: eid, name: string, listener: function) -> void

dispatchā€‹

Used to emit events that the listeners can listen to.

world.events.dispatch(target: eid, name: string, data: object /* (optional) */) -> void