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

62 lines
45 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 o,C as t,o as p,c as r,k as a,a as s,H as l,Q as e}from"./chunks/framework.4313453f.js";const ls=JSON.parse('{"title":"Container","description":"","frontmatter":{},"headers":[],"relativePath":"references/container.md","filePath":"references/container.md","lastUpdated":null}'),c={name:"references/container.md"},i=e('<h1 id="container" tabindex="-1">Container <a class="header-anchor" href="#container" aria-label="Permalink to &quot;Container&quot;"></a></h1><p>Container is the base class for all frame types. It provides the basic structure and functionality for all frame elements. Container elements can contain other container elements, thus forming the foundation for the hierarchy of frame elements.</p><p>Container inherit from <a href="./visualelement.html">VisualElement</a> and <a href="./element.html">BasicElement</a></p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to &quot;Properties&quot;"></a></h2><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>children</td><td>table</td><td>A list containing all child elements within the container.</td></tr><tr><td>childrenByName</td><td>table</td><td>A mapping of child elements by their respective names.</td></tr><tr><td>childrenEvents</td><td>table</td><td>A collection of events associated with child elements.</td></tr><tr><td>cursorBlink</td><td>bool</td><td>Indicates if the cursor blinks when a container is focused.</td></tr><tr><td>cursorColor</td><td>color</td><td>The color of the cursor within the container.</td></tr><tr><td>cursorX</td><td>number</td><td>The X-coordinate of the cursor within the container.</td></tr><tr><td>cursorY</td><td>number</td><td>The Y-coordinate of the cursor within the container.</td></tr><tr><td>focusedChild</td><td>element</td><td>The currently focused child element within the container.</td></tr><tr><td>elementsSorted</td><td>bool</td><td>Indicates if the child elements in the container are sorted.</td></tr><tr><td>xOffset</td><td>number</td><td>Horizontal offset for positioning child elements within the container.</td></tr><tr><td>yOffset</td><td>number</td><td>Vertical offset for positioning child elements within the container.</td></tr></tbody></table><h1 id="methods" tabindex="-1">Methods <a class="header-anchor" href="#methods" aria-label="Permalink to &quot;Methods&quot;"></a></h1><table><thead><tr><th>Methods</th><th>Returns</th><th>Description</th></tr></thead><tbody><tr><td><a href="#getvisiblechildren">getVisibleChildren</a></td><td>table</td><td>Returns a table containing all visible child elements within the container.</td></tr><tr><td><a href="#ischildvisible">isChildVisible</a></td><td>boolean</td><td>Returns a boolean value indicating whether the specified child element is visible within the container.</td></tr><tr><td><a href="#forcevisiblechildrenupdate">forceVisibleChildrenUpdate</a></td><td>self</td><td>Forces to update all child elements within the container.</td></tr><tr><td><a href="#getchild">getChild</a></td><td>element</td><td>Returns the specified child element within the container.</td></tr><tr><td><a href="#addchild">addChild</a></td><td>self</td><td>Adds a child element to the container.</td></tr><tr><td><a href="#removechild">removeChild</a></td><td>self</td><td>Removes a child element from the container.</td></tr><tr><td><a href="#iseventregistered">isEventRegistered</a></td><td>self</td><td>Checks if a certain event is registered for a child.</td></tr><tr><td><a href="#addevent">addEvent</a></td><td>self</td><td>Adds an event for a child.</td></tr><tr><td><a href="#removeevent">removeEvent</a></td><td>self</td><td>Removes an event from the container, bound to a child.</td></tr><tr><td><a href="#getvisiblechildrenevents">getVisibleChildrenEvents</a></td><td>table</td><td>Returns all visible children of the container for a certain event.</td></tr><tr><td><a href="#updatechild">updateChild</a></td><td>self</td><td>Updates the z-position of a specific child element.</td></tr><tr><td><a href="#setcursor">setCursor</a></td><td>self</td><td>Sets the cursor position within the container.</td></tr><tr><td><a href="#add-element">add{Element}</a></td><td>element</td><td>Adds a specific type of element (e.g., addButton, addFrame, addInput, addLabel) to the container.</td></tr></tbody></table>',7),d={id:"getvisiblechildren",tabindex:"-1"},h=a("a",{class:"header-anchor",href:"#getvisiblechildren","aria-label":'Permalink to "getVisibleChildren <C content="getVisibleChildren"/>"'},"",-1),y=e(`<p>Returns a table containing all visible child elements within the container.</p><h3 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>table</code> visible children</li></ol><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> visibleChildren </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">getVisibleChildren</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> visibleChildren </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">getVisibleChildren</span><span style="color:#24292E;">()</span></span></code></pre></div></details>`,4),E={id:"ischildvisible",tabindex:"-1"},u=a("a",{class:"header-anchor",href:"#ischildvisible","aria-label":'Permalink to "isChildVisible <C content="getVisibleChildren"/>"'},"",-1),m=e(`<p>Checks whether the specified child element is visible within the container.</p><h3 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>element</code> (element): The child element to check for visibility</li></ol><h3 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>boolean</code> true if its visible, otherwise false</li></ol><h3 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to &quot;Usage&quot;"></a></h3><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> isVisible </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">isChildVisible</span><span style="color:#E1E4E8;">(button)</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> isVisible </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">isChildVisible</span><span style="color:#24292E;">(button)</span></span></code></pre></div></details>`,7),b={id:"forcevisiblechildrenupdate",tabindex:"-1"},C=a("a",{class:"header-anchor",href:"#forcevisiblechildrenupdate","aria-label":'Permalink to "forceVisibleChildrenUpdate <C content="forceVisibleChildrenUpdate"/>"'},"",-1),_=e(`<p>Forces an update of the render-data for all child elements within the container. Elements won&#39;t re-render if nothing has changed, this would force them to re-render.</p><h3 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>self</code></li></ol><h3 id="usage-1" tabindex="-1">Usage <a class="header-anchor" href="#usage-1" aria-label="Permalink to &quot;Usage&quot;"></a></h3><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> visibleChildren </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">getVisibleChildren</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> visibleChildren </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">getVisibleChildren</span><span style="color:#24292E;">()</span></span></code></pre></div></details>`,5),F={id:"getchild",tabindex:"-1"},g=a("a",{class:"header-anchor",href:"#getchild","aria-label":'Permalink to "getChild <C content="getChild"/>"'},"",-1),v=e(`<p>Returns the specified child element within the container.</p><h3 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>string</code> id - The ID of the element.</li></ol><h3 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>element</code> The specified child element.</li></ol><h3 id="usage-2" tabindex="-1">Usage <a class="header-anchor" href="#usage-2" aria-label="Permalink to &quot;Usage&quot;"></a></h3><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Button1&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- some code</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">getChild</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Button1&quot;</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Button1&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">-- some code</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">getChild</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Button1&quot;</span><span style="color:#24292E;">)</span></span></code></pre></div></details>`,7),f={id:"addchild",tabindex:"-1"},k=a("a",{class:"header-anchor",href:"#addchild","aria-label":'Permalink to "addChild <C content="addChild"/>"'},"",-1),B=e(`<p>Adds a child element to the container.</p><h3 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>element</code> The child element to add.</li></ol><h3 id="returns-4" tabindex="-1">Returns <a class="header-anchor" href="#returns-4" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>element</code> The element in use.</li></ol><h3 id="usage-3" tabindex="-1">Usage <a class="header-anchor" href="#usage-3" aria-label="Permalink to &quot;Usage&quot;"></a></h3><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">create</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Button1&quot;</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">nil</span><span style="color:#E1E4E8;">, </span><span style="color:#9ECBFF;">&quot;Button&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addChild</span><span style="color:#E1E4E8;">(button)</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">create</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Button1&quot;</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">nil</span><span style="color:#24292E;">, </span><span style="color:#032F62;">&quot;Button&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addChild</span><span style="color:#24292E;">(button)</span></span></code></pre></div></details>`,7),A={id:"removechild",tabindex:"-1"},T=a("a",{class:"header-anchor",href:"#removechild","aria-label":'Permalink to "removeChild <C content="removeChild"/>"'},"",-1),q=e(`<p>Removes a child element from the container.</p><h3 id="parameters-3" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-3" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>element</code> The child element to remove.</li></ol><h3 id="returns-5" tabindex="-1">Returns <a class="header-anchor" href="#returns-5" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>self</code> The container itself</li></ol><h3 id="usage-4" tabindex="-1">Usage <a class="header-anchor" href="#usage-4" aria-label="Permalink to &quot;Usage&quot;"></a></h3><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">removeChild</span><span style="color:#E1E4E8;">(button)</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">removeChild</span><span style="color:#24292E;">(button)</span></span></code></pre></div></details>`,7),P={id:"iseventregistered",tabindex:"-1"},D=a("a",{class:"header-anchor",href:"#iseventregistered","aria-label":'Permalink to "isEventRegistered <C content="isEventRegistered"/>"'},"",-1),x=e(`<p>Checks if a certain event is registered for a child</p><h3 id="parameters-4" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-4" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>string</code> The name of the event to check.</li></ol><h3 id="returns-6" tabindex="-1">Returns <a class="header-anchor" href="#returns-6" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>boolean</code> Indicates whether the event is registered for a child</li></ol><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">removeChild</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;mouse_click&quot;</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">removeChild</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;mouse_click&quot;</span><span style="color:#24292E;">)</span></span></code></pre></div></details>`,6),V={id:"addevent",tabindex:"-1"},R=a("a",{class:"header-anchor",href:"#addevent","aria-label":'Permalink to "addEvent <C content="addEvent"/>"'},"",-1),S=e(`<p>Adds an event for a child. This will tell the container to send certain events to a children element.</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Basalt automatically registers children events for you.</p></div><h3 id="parameters-5" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-5" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>string</code> The name of the event to add.</li></ol><h3 id="returns-7" tabindex="-1">Returns <a class="header-anchor" href="#returns-7" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>self</code> The container itself.</li></ol><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addEvent</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;mouse_scroll&quot;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">-- Button will start to listen to mouse_scroll events, but there is no mouse_scroll handler for buttons.</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addEvent</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;mouse_scroll&quot;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">-- Button will start to listen to mouse_scroll events, but there is no mouse_scroll handler for buttons.</span></span></code></pre></div></details>`,7),I={id:"removeevent",tabindex:"-1"},w=a("a",{class:"header-anchor",href:"#removeevent","aria-label":'Permalink to "removeEvent <C content="removeEvent"/>"'},"",-1),M=e(`<p>Removes an event from the container, bound to a child.</p><h3 id="parameters-6" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-6" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>string</code> The name of the event to remove.</li><li><code>element</code> The child element.</li></ol><h3 id="returns-8" tabindex="-1">Returns <a class="header-anchor" href="#returns-8" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>self</code> The container itself.</li></ol><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">removeEvent</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;mouse_click&quot;</span><span style="color:#E1E4E8;">, button) </span><span style="color:#6A737D;">-- button stops listening to click events</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">removeEvent</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;mouse_click&quot;</span><span style="color:#24292E;">, button) </span><span style="color:#6A737D;">-- button stops listening to click events</span></span></code></pre></div></details>`,6),N={id:"getvisiblechildrenevents",tabindex:"-1"},U=a("a",{class:"header-anchor",href:"#getvisiblechildrenevents","aria-label":'Permalink to "getVisibleChildrenEvents <C content="getVisibleChildrenEvents"/>"'},"",-1),z=e(`<p>Returns all visible children of the container for a certain event.</p><h3 id="parameters-7" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-7" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>string</code> The name of the event.</li></ol><h3 id="returns-9" tabindex="-1">Returns <a class="header-anchor" href="#returns-9" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>self</code> The container itself.</li></ol><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> childrenWithClickEvent </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">getVisibleChildrenEvents</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;mouse_click&quot;</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> childrenWithClickEvent </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">getVisibleChildrenEvents</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;mouse_click&quot;</span><span style="color:#24292E;">)</span></span></code></pre></div></details>`,6),$={id:"updatechild",tabindex:"-1"},O=a("a",{class:"header-anchor",href:"#updatechild","aria-label":'Permalink to "updateChild <C content="updateChild"/>"'},"",-1),W=e(`<p>Updates the z-position of a specific child element. If certain elements have the same z-position, this method will remove and re-add the specific element in the same z-index table.</p><h3 id="parameters-8" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-8" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>string|element</code> The child element to update.</li></ol><h3 id="returns-10" tabindex="-1">Returns <a class="header-anchor" href="#returns-10" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>self</code> The container itself.</li></ol><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button1 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button2 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">updateChild</span><span style="color:#E1E4E8;">(button1)</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button1 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button2 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">updateChild</span><span style="color:#24292E;">(button1)</span></span></code></pre></div></details>`,6),H={id:"setcursor",tabindex:"-1"},L=a("a",{class:"header-anchor",href:"#setcursor","aria-label":'Permalink to "setCursor <C content="setCursor"/>"'},"",-1),X=e(`<p>Sets the cursor position within the container. This method is used by input or textfield elements.</p><h3 id="parameters-9" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-9" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>boolean</code> If the cursor should be active.</li><li><code>number?</code> The x-coordinate of the cursor.</li><li><code>number?</code> The x-coordinate of the cursor.</li><li><code>color?</code> The color of the cursor.</li></ol><h3 id="returns-11" tabindex="-1">Returns <a class="header-anchor" href="#returns-11" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>self</code> The container itself.</li></ol><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">setCursor</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">true</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">2</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">2</span><span style="color:#E1E4E8;">, colors.</span><span style="color:#B392F0;">red</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">setCursor</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">true</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">2</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">2</span><span style="color:#24292E;">, colors.</span><span style="color:#6F42C1;">red</span><span style="color:#24292E;">)</span></span></code></pre></div></details>`,6),Y={id:"add-element",tabindex:"-1"},G=a("a",{class:"header-anchor",href:"#add-element","aria-label":'Permalink to "add\\{Element\\} <C content="addButton"/>"'},"",-1),J=e(`<p>Adds a specific type of element (e.g., addButton, addFrame, addInput, addLabel) to the container.</p><h3 id="parameters-10" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-10" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ol><li><code>string|table</code> The name of the element or a table containing default properties.</li></ol><h3 id="returns-12" tabindex="-1">Returns <a class="header-anchor" href="#returns-12" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>self</code> The container itself.</li></ol><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;"> main </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">getMainFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button1 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;Button1&quot;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> button2 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">main</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addButton</span><span style="color:#E1E4E8;">({name</span><span style="color:#F97583;">=</span><span style="color:#9ECBFF;">&quot;Button2&quot;</span><span style="color:#E1E4E8;">,x</span><span style="color:#F97583;">=</span><span style="color:#79B8FF;">3</span><span style="color:#E1E4E8;">,y</span><span style="color:#F97583;">=</span><span style="color:#79B8FF;">4</span><span style="color:#E1E4E8;">,width</span><span style="color:#F97583;">=</span><span style="color:#79B8FF;">16</span><span style="color:#E1E4E8;">,height</span><span style="color:#F97583;">=</span><span style="color:#79B8FF;">3</span><span style="color:#E1E4E8;">,text</span><span style="color:#F97583;">=</span><span style="color:#9ECBFF;">&quot;Click me!&quot;</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;"> main </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">getMainFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button1 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;Button1&quot;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> button2 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">main</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addButton</span><span style="color:#24292E;">({name</span><span style="color:#D73A49;">=</span><span style="color:#032F62;">&quot;Button2&quot;</span><span style="color:#24292E;">,x</span><span style="color:#D73A49;">=</span><span style="color:#005CC5;">3</span><span style="color:#24292E;">,y</span><span style="color:#D73A49;">=</span><span style="color:#005CC5;">4</span><span style="color:#24292E;">,width</span><span style="color:#D73A49;">=</span><span style="color:#005CC5;">16</span><span style="color:#24292E;">,height</span><span style="color:#D73A49;">=</span><span style="color:#005CC5;">3</span><span style="color:#24292E;">,text</span><span style="color:#D73A49;">=</span><span style="color:#032F62;">&quot;Click me!&quot;</span><span style="color:#24292E;">})</span></span></code></pre></div></details>`,6);function Q(j,K,Z,ss,as,es){const n=t("C");return p(),r("div",null,[i,a("h2",d,[s("getVisibleChildren "),l(n,{content:"getVisibleChildren"}),s(),h]),y,a("h2",E,[s("isChildVisible "),l(n,{content:"getVisibleChildren"}),s(),u]),m,a("h2",b,[s("forceVisibleChildrenUpdate "),l(n,{content:"forceVisibleChildrenUpdate"}),s(),C]),_,a("h2",F,[s("getChild "),l(n,{content:"getChild"}),s(),g]),v,a("h2",f,[s("addChild "),l(n,{content:"addChild"}),s(),k]),B,a("h2",A,[s("removeChild "),l(n,{content:"removeChild"}),s(),T]),q,a("h2",P,[s("isEventRegistered "),l(n,{content:"isEventRegistered"}),s(),D]),x,a("h2",V,[s("addEvent "),l(n,{content:"addEvent"}),s(),R]),S,a("h2",I,[s("removeEvent "),l(n,{content:"removeEvent"}),s(),w]),M,a("h2",N,[s("getVisibleChildrenEvents "),l(n,{content:"getVisibleChildrenEvents"}),s(),U]),z,a("h2",$,[s("updateChild "),l(n,{content:"updateChild"}),s(),O]),W,a("h2",H,[s("setCursor "),l(n,{content:"setCursor"}),s(),L]),X,a("h2",Y,[s("add{Element} "),l(n,{content:"addButton"}),s(),G]),J])}const os=o(c,[["render",Q]]);export{ls as __pageData,os as default};