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.
-See also:
--
-
Usage:
--
-
local basalt = require("basalt")
-local mainFrame = basalt.createFrame()
-mainFrame:show()
-basalt.run()
-
-
- Info:
--
-
- Copyright: 2025 -
- Release: 2.0 -
- License: MIT -
- Author: NyoriE -
Class Basalt
-| basalt:create(type[, id]) | -Creates a new UI element - Creates and returns a new UI element of the specified type | -
| basalt:createFrame() | -Creates and returns a new frame | -
| basalt:getElementManager() | -Returns the element manager instance | -
| basalt:getMainFrame() | -Gets or creates the main frame | -
| basalt:removeSchedule(id) | -Removes a scheduled update | -
| basalt:run([isActive]) | -Starts the Basalt runtime | -
| basalt:scheduleUpdate(func) | -Schedules a function to be updated | -
| basalt:setActiveFrame(frame) | -Sets the active frame | -
| basalt:stop() | -Stops the Basalt runtime | -
| basalt:update() | -Updates all scheduled functions | -
-
- - -
Class Basalt
- --
-
- - - basalt:create(type[, id]) - -
-
- Creates a new UI element
- Creates and returns a new UI element of the specified type
-
-
-
Parameters:
--
-
- type - string The type of element to create (e.g. "Button", "Label", "BaseFrame") - -
- id - string Optional unique identifier for the element - (optional) - -
Returns:
--
-
- table
- The created element instance
-
See also:
--
-
Usage:
--
-
local button = basalt.create("Button", "myButton") -button:setPosition(5, 5)
- - -
- - - - basalt:createFrame() - -
-
- Creates and returns a new frame
-
-
-
-
Returns:
--
-
- table The created frame instance
-
Usage:
--
-
local mainFrame = basalt.createFrame()
- - -
- - - - basalt:getElementManager() - -
-
- Returns the element manager instance
-
-
-
-
Returns:
--
-
- table The element manager
-
Usage:
--
-
local manager = basalt.getElementManager()
- - -
- - - - basalt:getMainFrame() - -
-
- Gets or creates the main frame
-
-
-
-
Returns:
--
-
- table The main frame instance
-
Usage:
--
-
local frame = basalt.getMainFrame()
- - -
- - - - basalt:removeSchedule(id) - -
-
- Removes a scheduled update
-
-
-
Parameters:
--
-
- id - number The schedule ID to remove - -
Usage:
--
-
basalt.removeSchedule(scheduleId)- - -
- - - - basalt:run([isActive]) - -
-
- Starts the Basalt runtime
-
-
-
Parameters:
--
-
- isActive - boolean Whether to start active (default: true) - (optional) - -
Usage:
--
-
basalt.run()
- basalt.run(false)
-
- - - - basalt:scheduleUpdate(func) - -
-
- Schedules a function to be updated
-
-
-
Parameters:
--
-
- func - function The function to schedule - -
Returns:
--
-
- number The schedule ID
-
Usage:
--
-
local id = basalt.scheduleUpdate(myFunction)
- - -
- - - - basalt:setActiveFrame(frame) - -
-
- Sets the active frame
-
-
-
Parameters:
--
-
- frame - table The frame to set as active - -
Returns:
--
-
- boolean Always returns false
-
Usage:
--
-
basalt.setActiveFrame(myFrame)- - -
- - - - basalt:stop() - -
-
- Stops the Basalt runtime
-
-
-
-
-
-
-
Usage:
--
-
basalt.stop()- - -
- - - - basalt:update() - -
-
- Updates all scheduled functions
-
-
-
-
-
-
-
Usage:
--
-
basalt.update()- - -
-