1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
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('<h1 id="interface-globalevents" tabindex="-1">Interface: GlobalEvents <a class="header-anchor" href="#interface-globalevents" aria-label="Permalink to "Interface: GlobalEvents""></a></h1><p><a href="./../../modules/game/events">game/events</a>.GlobalEvents</p><p>All types of events able to be sent or emitted from the global event bus.</p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to "Properties""></a></h2><h3 id="addlayer" tabindex="-1">addLayer <a class="header-anchor" href="#addlayer" aria-label="Permalink to "addLayer""></a></h3><p>• <strong>addLayer</strong>: (<code>layer</code>: <a href="./../../modules/game/layers#genericlayer"><code>GenericLayer</code></a>, <code>saveData</code>: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a><<code>string</code>, <code>unknown</code>>) => <code>void</code></p><h4 id="type-declaration" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>layer</code>, <code>saveData</code>): <code>void</code></p><p>Sent whenever a layer is added.</p><h5 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>layer</code></td><td style="text-align:left;"><a href="./../../modules/game/layers#genericlayer"><code>GenericLayer</code></a></td><td style="text-align:left;">The layer being added.</td></tr><tr><td style="text-align:left;"><code>saveData</code></td><td style="text-align:left;"><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a><<code>string</code>, <code>unknown</code>></td><td style="text-align:left;">The layer's save data object within player.</td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></p><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/game/events.ts#L13" target="_blank" rel="noreferrer">profectus/src/game/events.ts:13</a></p><hr><h3 id="fontsloaded" tabindex="-1">fontsLoaded <a class="header-anchor" href="#fontsloaded" aria-label="Permalink to "fontsLoaded""></a></h3><p>• <strong>fontsLoaded</strong>: <code>VoidFunction</code></p><p>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.</p><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/game/events.ts#L51" target="_blank" rel="noreferrer">profectus/src/game/events.ts:51</a></p><hr><h3 id="gamewon" tabindex="-1">gameWon <a class="header-anchor" href="#gamewon" aria-label="Permalink to "gameWon""></a></h3><p>• <strong>gameWon</strong>: <code>VoidFunction</code></p><p>Sent when the game has ended.</p><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/game/events.ts#L35" target="_blank" rel="noreferrer">profectus/src/game/events.ts:35</a></p><hr><h3 id="loadsettings" tabindex="-1">loadSettings <a class="header-anchor" href="#loadsettings" aria-label="Permalink to "loadSettings""></a></h3><p>• <strong>loadSettings</strong>: (<code>settings</code>: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype" target="_blank" rel="noreferrer"><code>Partial</code></a><<a href="./settings.Settings"><code>Settings</code></a>>) => <code>void</code></p><h4 id="type-declaration-1" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration-1" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>settings</code>): <code>void</code></p><p>Sent when constructing the Settings object. Use it to add default values for custom properties to the object.</p><p><strong><code>See</code></strong></p><p>features/features.setDefault for setting default values.</p><h5 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>settings</code></td><td style="text-align:left;"><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype" target="_blank" rel="noreferrer"><code>Partial</code></a><<a href="./settings.Settings"><code>Settings</code></a>></td><td style="text-align:left;">The settings object being constructed.</td></tr></tbody></table><h5 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></p><h4 id="defined-in-3" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-3" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/game/events.ts#L31" target="_blank" rel="noreferrer">profectus/src/game/events.ts:31</a></p><hr><h3 id="onload" tabindex="-1">onLoad <a class="header-anchor" href="#onload" aria-label="Permalink to "onLoad""></a></h3><p>• <strong>onLoad</strong>: <code>VoidFunction</code></p><p>Sent whenever a save has finished loading. Happens when the page is opened and upon switching saves in the saves manager.</p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/game/events.ts#L46" target="_blank" rel="noreferrer">profectus/src/game/events.ts:46</a></p><hr><h3 id="removelayer" tabindex="-1">removeLayer <a class="header-anchor" href="#removelayer" aria-label="Permalink to "removeLayer""></a></h3><p>• <strong>removeLayer</strong>: (<code>layer</code>: <a href="./../../modules/game/layers#genericlayer"><code>GenericLayer</code></a>) => <code>void</code></p><h4 id="type-declaration-2" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration-2" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>layer</code>): <code>void</code></p><p>Sent whenever a layer is removed.</p><h5 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>layer</code></td><td style="text-align:left;"><a href="./../../modules/game/layers#genericlayer"><code>GenericLayer</code></a></td><td style="text-align:left;">The layer being removed.</td></tr></tbody></table><h5 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></p><h4 id="defined-in-5" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-5" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/game/events.ts#L18" target="_blank" rel="noreferrer">profectus/src/game/events.ts:18</a></p><hr><h3 id="reset" tabindex="-1">reset <a class="header-anchor" href="#reset" aria-label="Permalink to "reset""></a></h3><p>• <strong>reset</strong>: (<code>reset</code>: <a href="./../../modules/features/reset#genericreset"><code>GenericReset</code></a>) => <code>void</code></p><h4 id="type-declaration-3" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration-3" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>reset</code>): <code>void</code></p><h5 id="parameters-3" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-3" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>reset</code></td><td style="text-align:left;"><a href="./../../modules/features/reset#genericreset"><code>GenericReset</code></a></td></tr></tbody></table><h5 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></p><h4 id="defined-in-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/reset.ts#L117" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:117</a></p><hr><h3 id="setupvue" tabindex="-1">setupVue <a class="header-anchor" href="#setupvue" aria-label="Permalink to "setupVue""></a></h3><p>• <strong>setupVue</strong>: (<code>vue</code>: <code>App</code><<code>any</code>>) => <code>void</code></p><h4 id="type-declaration-4" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration-4" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>vue</code>): <code>void</code></p><p>Sent when setting up the Vue Application instance. Use it to register global components or otherwise set up things that should affect Vue globally.</p><h5 id="parameters-4" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-4" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>vue</code></td><td style="text-align:left;"><code>App</code><<code>any</code>></td><td style="text-align:left;">The Vue App being constructed.</td></tr></tbody></table><h5 id="returns-4" tabindex="-1">Returns <a class="header-anchor" href="#returns-4" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></p><h4 id="defined-in-7" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-7" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/game/events.ts#L41" target="_blank" rel="noreferrer">profectus/src/game/events.ts:41</a></p><hr><h3 id="update" tabindex="-1">update <a class="header-anchor" href="#update" aria-label="Permalink to "update""></a></h3><p>• <strong>update</strong>: (<code>diff</code>: <code>number</code>, <code>trueDiff</code>: <code>number</code>) => <code>void</code></p><h4 id="type-declaration-5" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration-5" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>diff</code>, <code>trueDiff</code>): <code>void</code></p><p>Sent every game tick. Runs the life cycle of the project.</p><h5 id="parameters-5" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-5" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>diff</code></td><td style="text-align:left;"><code>number</code></td><td style="text-align:left;">The delta time since last tick, in ms.</td></tr><tr><td style="text-align:left;"><code>trueDiff</code></td><td style="text-align:left;"><code>number</code></td><td style="text-align:left;">The delta time since last tick, in ms. Unaffected by time modifiers like <a href="./player.Player#devspeed">devSpeed</a> or <a href="./player.Player#offlinetime">offlineTime</a>. Intended for things like updating animations.</td></tr></tbody></table><h5 id="returns-5" tabindex="-1">Returns <a class="header-anchor" href="#returns-5" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></p><h4 id="defined-in-8" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-8" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/game/events.ts#L24" target="_blank" rel="noreferrer">profectus/src/game/events.ts:24</a></p>',94),n=[d];function i(l,s,c,h,f,p){return a(),t("div",null,n)}const b=e(o,[["render",i]]);export{g as __pageData,b as default};
|