import{_ as a,o as e,c as s,Q as n}from"./chunks/framework.4313453f.js";const u=JSON.parse('{"title":"Baseframe","description":"","frontmatter":{},"headers":[],"relativePath":"references/baseframe.md","filePath":"references/baseframe.md","lastUpdated":null}'),l={name:"references/baseframe.md"},t=n(`<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 github-dark vp-code-dark"><code><span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> basalt </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">require</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;basalt&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">addFrame</span><span style="color:#E1E4E8;">() </span><span style="color:#6A737D;">-- a new baseframe is created.</span></span>
<span class="line"></span>
<span class="line"><span style="color:#E1E4E8;">basalt.</span><span style="color:#79B8FF;">autoUpdate</span><span style="color:#E1E4E8;">()</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> basalt </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">require</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;basalt&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">addFrame</span><span style="color:#24292E;">() </span><span style="color:#6A737D;">-- a new baseframe is created.</span></span>
<span class="line"></span>
<span class="line"><span style="color:#24292E;">basalt.</span><span style="color:#005CC5;">autoUpdate</span><span style="color:#24292E;">()</span></span></code></pre></div></details>`,6),o=[t];function r(p,c,i,m,d,y){return e(),s("div",null,o)}const f=a(l,[["render",r]]);export{u as __pageData,f as default};
