2 lines
14 KiB
JavaScript
2 lines
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 cla
|