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
- .listen
- .onEvent
- .addEventListener
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
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier for the location |
| imageUrl | string | The location image |
| title | string | The location title |
| lat | number | Latitude of the location |
| lng | number | Longitude of the location |
| mapPoint | Eid | The spawned map point entity to parent your content under |
Example (Global)
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(eid, ecs.events.LOCATION_SPAWNED, (event) => {
console.log('Location spawned: ', event.data.lat, event.data.lng)
})