profectus-docs/assets/api_modules_game_events.md.b67aaa97.js

2 lines
5.5 KiB
JavaScript
Raw Normal View History

import{_ as e,c as t,o as a,N as o}from"./chunks/framework.0799945b.js";const b=JSON.parse('{"title":"Module: game/events","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/game/events.md","lastUpdated":null}'),d={name:"api/modules/game/events.md"},l=o('<h1 id="module-game-events" tabindex="-1">Module: game/events <a class="header-anchor" href="#module-game-events" aria-label="Permalink to &quot;Module: game/events&quot;"></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to &quot;Interfaces&quot;"></a></h2><h3 id="globalevents" tabindex="-1">GlobalEvents <a class="header-anchor" href="#globalevents" aria-label="Permalink to &quot;GlobalEvents&quot;"></a></h3><p> <strong>GlobalEvents</strong>: <code>Object</code></p><p>All types of events able to be sent or emitted from the global event bus.</p><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>addLayer</code></td><td style="text-align:left;">(<code>layer</code>: <a href="./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>&lt;<code>string</code>, <code>unknown</code>&gt;) =&gt; <code>void</code></td><td style="text-align:left;">Sent whenever a layer is added.</td></tr><tr><td style="text-align:left;"><code>fontsLoaded</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">Using document.fonts.ready returns too early on firefox, so we use document.fonts.onloadingdone instead, which doesn&#39;t accept multiple listeners. This event fires when that callback is called.</td></tr><tr><td style="text-align:left;"><code>gameWon</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">Sent when the game has ended.</td></tr><tr><td style="text-align:left;"><code>loadSettings</code></td><td style="text-align:left;">(<code>settings</code>: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype" target="_blank" rel="noreferrer"><code>Partial</code></a>&lt;<a href="./settings#settings"><code>Settings</code></a>&gt;) =&gt; <code>void</code></td><td style="text-align:left;">Sent when constructing the Settings object. Use it to add default values for custom properties to the object. <strong><code>See</code></strong> features/features.setDefault for setting default values.</td></tr><tr><td style="text-align:left;"><code>onLoad</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">Sent whenever a save has finished loading. Happens when the page is opened and upon switching saves in the saves manager.</td></tr><tr><td style="text-align:left;"><code>removeLayer</code></td><td style="text-align:left;">(<code>layer</code>: <a href="./layers#genericlayer"><code>GenericLayer</code></a>) =&gt; <code>void</code></td><td style="text-align:left;">Sent whenever a layer is removed.</td></tr><tr><td style="text-align:left;"><code>reset</code></td><td style="text-align:left;">(<code>reset</code>: <a href="./../features/reset#genericreset"><code>GenericReset</code></a>) =&gt; <code>void</code></td><td style="text-align:left;">-</td></tr><tr><td style="text-align:left;"><code>setupVue</code></td><td style="text-align:left;">(<code>vue</code>: <code>App</code>&lt;<code>any</code>&gt;) =&gt; <code>void</code></td><td style="text-align:left;">Sent when setting up the Vue Application instance. Use it to register global components or otherwise set up things that should affect Vue globally.</td></tr><tr><td style="text-align:left;"><code>update</code></td><td style="text-align:left;">(<code>diff</code>: <code>number</code>, <code>trueDiff</code>: <code>number</code>) =&gt; <code>void</code></td><td style="text-align:lef