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

8 lines
3.8 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.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as a,o as s,c as o,Q as e}from"./chunks/framework.4313453f.js";const u=JSON.parse('{"title":"Program","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"references/program.md","filePath":"references/program.md","lastUpdated":null}'),r={name:"references/program.md"},t=e(`<h1 id="program" tabindex="-1">Program <a class="header-anchor" href="#program" aria-label="Permalink to &quot;Program&quot;"></a></h1><p>Program objects allow you to execute other programs within your main application. You can run programs such as worms, shell, or any custom programs youve created.</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>program</td><td>object</td><td>The internal program object</td></tr></tbody></table><h2 id="start" tabindex="-1">start <a class="header-anchor" href="#start" aria-label="Permalink to &quot;start&quot;"></a></h2><p>Starts a existing program</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>string</code> Path to the program</li></ol><h3 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ol><li><code>object</code> The object in use</li></ol><h3 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to &quot;Usage&quot;"></a></h3><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;"> mainFrame </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> basalt.</span><span style="color:#79B8FF;">addFrame</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#F97583;">local</span><span style="color:#E1E4E8;"> aProgram </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">mainFrame</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">addProgram</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#B392F0;">aProgram</span><span style="color:#E1E4E8;">:</span><span style="color:#79B8FF;">start</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&quot;path/to/your/program.lua&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;"> mainFrame </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> basalt.</span><span style="color:#005CC5;">addFrame</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#D73A49;">local</span><span style="color:#24292E;"> aProgram </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">mainFrame</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">addProgram</span><span style="color:#24292E;">()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6F42C1;">aProgram</span><span style="color:#24292E;">:</span><span style="color:#005CC5;">start</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&quot;path/to/your/program.lua&quot;</span><span style="color:#24292E;">)</span></span></code></pre></div>`,12),n=[t];function l(p,c,i,d,h,m){return s(),o("div",null,n)}const E=a(r,[["render",l]]);export{u as __pageData,E as default};