import{_ as e,c as t,o as a,N as r}from"./chunks/framework.0799945b.js";const g=JSON.parse('{"title":"Interface: GlobalEvents","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/interfaces/game/events.GlobalEvents.md","lastUpdated":null}'),o={name:"api/interfaces/game/events.GlobalEvents.md"},d=r('
game/events.GlobalEvents
All types of events able to be sent or emitted from the global event bus.
• addLayer: (layer
: GenericLayer
, saveData
: Record
<string
, unknown
>) => void
▸ (layer
, saveData
): void
Sent whenever a layer is added.
Name | Type | Description |
---|---|---|
layer | GenericLayer | The layer being added. |
saveData | Record <string , unknown > | The layer's save data object within player. |
void
profectus/src/game/events.ts:13
• fontsLoaded: VoidFunction
Using document.fonts.ready returns too early on firefox, so we use document.fonts.onloadingdone instead, which doesn't accept multiple listeners. This event fires when that callback is called.
profectus/src/game/events.ts:51
• gameWon: VoidFunction
Sent when the game has ended.
profectus/src/game/events.ts:35
• loadSettings: (settings
: Partial
<Settings
>) => void
▸ (settings
): void
Sent when constructing the Settings object. Use it to add default values for custom properties to the object.
See
features/features.setDefault for setting default values.
Name | Type | Description |
---|---|---|
settings | Partial <Settings > | The settings object being constructed. |
void
profectus/src/game/events.ts:31
• onLoad: VoidFunction
Sent whenever a save has finished loading. Happens when the page is opened and upon switching saves in the saves manager.
profectus/src/game/events.ts:46
• removeLayer: (layer
: GenericLayer
) => void
▸ (layer
): void
Sent whenever a layer is removed.
Name | Type | Description |
---|---|---|
layer | GenericLayer | The layer being removed. |
void
profectus/src/game/events.ts:18
• reset: (reset
: GenericReset
) => void
▸ (reset
): void
Name | Type |
---|---|
reset | GenericReset |
void
profectus/src/features/reset.ts:117
• setupVue: (vue
: App
<any
>) => void
▸ (vue
): void
Sent when setting up the Vue Application instance. Use it to register global components or otherwise set up things that should affect Vue globally.
Name | Type | Description |
---|---|---|
vue | App <any > | The Vue App being constructed. |
void
profectus/src/game/events.ts:41
• update: (diff
: number
, trueDiff
: number
) => void
▸ (diff
, trueDiff
): void
Sent every game tick. Runs the life cycle of the project.
Name | Type | Description |
---|---|---|
diff | number | The delta time since last tick, in ms. |
trueDiff | number | The delta time since last tick, in ms. Unaffected by time modifiers like devSpeed or offlineTime. Intended for things like updating animations. |
void