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.
+Usage:
+-
+
local basalt = require("basalt")
+local mainFrame = basalt.createFrame()
+mainFrame:show()
+basalt.run()
+
+
+
+
+Class Basalt
+| basalt:create (type, id) | +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:setActiveFrame (frame) | +Sets the active frame | +
| basalt:scheduleUpdate (func) | +Schedules a function to be updated | +
| basalt:removeSchedule (id) | +Removes a scheduled update | +
| basalt.updateEvent (event, ...) | +Internal event handler | +
| basalt.renderFrames () | +Internal render function | +
| basalt:update () | +Updates all scheduled functions | +
| basalt:stop () | +Stops the Basalt runtime | +
| basalt:run (isActive) | +Starts the Basalt runtime | +
+
+ + +
Class Basalt
+ +
+ The main Basalt instance
+ Contains all core functionality and management functions
+
+ -
+
- + + basalt:create (type, id) + +
-
+ 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 + +
Returns:
+-
+
+ table element The created element instance
+
Usage:
+-
+
local button = basalt.create("Button")
+ + +
+ - + + basalt:createFrame () + +
-
+ Creates and returns a new frame
+
+
+
+
Returns:
+-
+
+ table BaseFrame The created frame instance
+
Usage:
+-
+
local mainFrame = basalt.createFrame()
+ + +
+ - + + basalt:getElementManager () + +
-
+ Returns the element manager instance
+
+
+
+
Returns:
+-
+
+ table ElementManager The element manager
+
Usage:
+-
+
local manager = basalt.getElementManager()
+ + +
+ - + + basalt:getMainFrame () + +
-
+ Gets or creates the main frame
+
+
+
+
Returns:
+-
+
+ BaseFrame table The main frame instance
+
Usage:
+-
+
local frame = basalt.getMainFrame()
+ + +
+ - + + basalt:setActiveFrame (frame) + +
-
+ Sets the active frame
+
+
+
Parameters:
+-
+
- frame + table The frame to set as active + +
Usage:
+-
+
basalt.setActiveFrame(myFrame)+ + +
+ - + + basalt:scheduleUpdate (func) + +
-
+ Schedules a function to be updated
+
+
+
Parameters:
+-
+
- func + function The function to schedule + +
Returns:
+-
+
+ number Id The schedule ID
+
Usage:
+-
+
local id = basalt.scheduleUpdate(myFunction)
+ + +
+ - + + basalt:removeSchedule (id) + +
-
+ Removes a scheduled update
+
+
+
Parameters:
+-
+
- id + number The schedule ID to remove + +
Usage:
+-
+
basalt.removeSchedule(scheduleId)+ + +
+ - + + basalt.updateEvent (event, ...) + +
-
+ Internal event handler
+
+
+
Parameters:
+-
+
- event + + + + +
- ... + + + + +
+ - + + basalt.renderFrames () + +
- + Internal render function + + + + + + + + +
- + + basalt:update () + +
-
+ Updates all scheduled functions
+
+
+
+
+
+
+
Usage:
+-
+
basalt.update()+ + +
+ - + + basalt:stop () + +
-
+ Stops the Basalt runtime
+
+
+
+
+
+
+
Usage:
+-
+
basalt.stop()+ + +
+ - + + basalt:run (isActive) + +
-
+ Starts the Basalt runtime
+
+
+
Parameters:
+-
+
- isActive + boolean Whether to start active (default: true) + +
Usage:
+-
+
basalt.run()
+ basalt.run(false)
+
+