Files
Basalt2/docs/.vitepress/dist/assets/references_baseframe.md.DJfcFM_J.js
Robert Jelic 31787b0e9b Fix
2025-02-16 18:04:24 +01:00

6 lines
3.3 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as a,c as e,o as s,a4 as t}from"./chunks/framework.nQaBHiNx.js";const f=JSON.parse('{"title":"Baseframe","description":"","frontmatter":{},"headers":[],"relativePath":"references/baseframe.md","filePath":"references/baseframe.md","lastUpdated":null}'),i={name:"references/baseframe.md"},n=t(`<h1 id="baseframe" tabindex="-1">Baseframe <a class="header-anchor" href="#baseframe" aria-label="Permalink to &quot;Baseframe&quot;"></a></h1><p>Base frames are fundamental elements in Basalt, typically the first element you need. They can be created using <a href="./basalt.html#basalt-addframe">basalt.addFrame</a>. Base frames are unique in that they do not require a parent container. They occupy the entire screen. If you need a BaseFrame that doesn&#39;t occupy the entire screen, consider using CC:Tweaked&#39;s <a href="https://tweaked.cc/module/window.html" target="_blank" rel="noreferrer">Window API</a>.</p><p>It&#39;s important to note that only one base frame can be active (visible) at a time. While you can create multiple base frames, only the currently active one listens to incoming events (except for some events like time-events and peripheral-events). To switch between BaseFrames, you can use <a href="./basalt.html#basalt-switchframe">basalt.switchFrame</a></p><p>Baseframe inherit from <a href="./container.html">Container</a>, <a href="./visualelement.html">VisualElement</a> and <a href="./element.html">BasicElement</a></p><h2 id="example" tabindex="-1">Example <a class="header-anchor" href="#example" aria-label="Permalink to &quot;Example&quot;"></a></h2><details class="details custom-block"><summary>Click to see example</summary><div class="language-lua vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">lua</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">local</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> basalt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> require</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;basalt&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">local</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> main </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> basalt.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">addFrame</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">-- a new baseframe is created.</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">basalt.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">autoUpdate</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span></code></pre></div></details>`,6),l=[n];function r(h,p,o,c,d,m){return s(),e("div",null,l)}const u=a(i,[["render",r]]);export{f as __pageData,u as default};