Files
Basalt2/index.md
2025-02-09 18:26:07 +00:00

4.9 KiB

<html> <head> </head>

Module basalt

Basalt UI Framework main module.

This is the main entry point for the Basalt UI Framework. It provides functions for creating and managing UI elements and handling events.



<dl class="function">
<dt>
<a name = "basalt:create"></a>
<strong>basalt:create&nbsp;(type, id)</strong>
</dt>
<dd>
Creates and returns a new UI element of the specified type




<h3>Usage:</h3>
<ul>
    <pre class="example">local button = basalt.create("Button")

basalt:createFrame ()
Creates and returns a new frame
<h3>Usage:</h3>
<ul>
    <pre class="example">local mainFrame = basalt.createFrame()

basalt:getElementManager ()
Returns the element manager instance
<h3>Usage:</h3>
<ul>
    <pre class="example">local manager = basalt.getElementManager()

basalt:getMainFrame ()
Gets or creates the main frame
<h3>Usage:</h3>
<ul>
    <pre class="example">local frame = basalt.getMainFrame()

basalt:setActiveFrame (frame)
Sets the active frame
<h3>Usage:</h3>
<ul>
    <pre class="example">basalt.setActiveFrame(myFrame)

basalt:scheduleUpdate (func)
Schedules a function to be updated
<h3>Usage:</h3>
<ul>
    <pre class="example">local id = basalt.scheduleUpdate(myFunction)

basalt:removeSchedule (id)
Removes a scheduled update
<h3>Usage:</h3>
<ul>
    <pre class="example">basalt.removeSchedule(scheduleId)

basalt.updateEvent
Internal event handler
basalt.renderFrames
Internal render function
basalt:update ()
Updates all scheduled functions
<h3>Usage:</h3>
<ul>
    <pre class="example">basalt.update()

basalt:stop ()
Stops the Basalt runtime
<h3>Usage:</h3>
<ul>
    <pre class="example">basalt.stop()

basalt:run (isActive)
Starts the Basalt runtime
<h3>Usage:</h3>
<ul>
    <li><pre class="example">basalt.run()

  • basalt.run(false)
    
  • </html>