Files
Basalt/docs/objects/Basalt.md
Robert Jelic 4d614372a1 Updated docs
There is still stuff to do
2022-08-28 18:18:26 +02:00

1.7 KiB

This is the UI Manager and the first thing you want to access. Before you can access Basalt, you need to add the following code on top of your file:

local basalt = require("basalt")

require loads the UI Framework into your project.

Now you are able to access the following list of methods:

createFrame Creates a new base frame
removeFrame Removes a previously created base frame
getFrame Returns a frame object by it's id
getActiveFrame Returns the currently active base frame
autoUpdate Starts the event and draw listener
update Starts the event and draw listener once
stopUpdate Stops the currently active event and draw listener
isKeyDown Returns if the key is held down
debug Writes something into the debug console
log Writes something into the log file
setTheme Changes the base theme of basalt
setVariable Sets a variable which you can access via XML
schedule Schedules a new task

Examples

Here is a lua example on how to create a empty base frame and start basalt's listener.

local basalt = require("basalt") -- we load the UI Framework into our project

local main = basalt.createFrame() -- we create a base frame - on that frame we are able to add object's

-- here we would add additional object's

basalt.autoUpdate() -- we start listening to incoming events and draw stuff on the screen