Module basalt

Basalt UI Framework main module

Info:

  • Copyright: 2025
  • License: MIT
  • Author: NyoriE

Class Basalt

basalt:create(type[, id]) Creates a new UI element
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

The main Basalt instance
basalt:create(type[, id])
Creates a new UI element

Parameters:

  • type string The type of element to create (e.g. "BaseFrame")
  • id string Optional ID for the element (optional)

Returns:

    table The created element instance

Usage:

    local button = basalt.create("Button", "myButton")
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()
generated by LDoc 1.5.0 Last updated 2025-02-09 15:18:44