Skip to main content

General Events

Events

ACTIVE_SPACE_CHANGE

Emitted on the world.events.globalId when the world loads a Space (no promise of the Space being loaded).

Properties

None.

Example

defineState('initial-state').initial().listen(world.events.globalId, ecs.events.ACTIVE_SPACE_CHANGE, () => {
console.log('Active space change')
})

LOCATION_SPAWNED

Emitted on the map eid and world.events.globalId when a VPS Location is spawned on the map.

Properties

PropertyTypeDescription
idstringThe unique identifier for the location
imageUrlstringThe location image
titlestringThe location title
latnumberLatitude of the location
lngnumberLongitude of the location
mapPointEidThe spawned map point entity to parent your content under

Example (Global)

defineState('initial-state').initial().listen(eid, ecs.events.LOCATION_SPAWNED, (event) => {
console.log('Location spawned: ', event.data.lat, event.data.lng)
})