Docs: Basalt.md update

Changes:
* Rewording
* Add forgotten methods
* Sort methods
This commit is contained in:
Erb3
2022-09-12 20:09:14 +02:00
parent 140f1b0014
commit 00fff1c2f0

View File

@@ -1,37 +1,46 @@
# Basalt
This is the UI Manager and the first thing you want to access. 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: Before you can access Basalt, you need to add the following code on top of your file:
`local basalt = require("basalt")` ```lua
local basalt = require("basalt")
```
require loads the UI Framework into your project. What this code does is it loads basalt into the basalt variable.
You are now able to access the following list of methods:
Now you are able to access the following list of methods:
| | | | | |
|---|---| |---|---|
|[autoUpdate](objects/Basalt/autoUpdate.md)|Starts the event and draw listener
|[createFrame](objects/Basalt/createFrame.md)|Creates a new base frame |[createFrame](objects/Basalt/createFrame.md)|Creates a new base frame
|[removeFrame](objects/Basalt/removeFrame.md)|Removes a previously created base frame |[debug](objects/Basalt/debug.md)|Writes something into the debug console
|[getFrame](objects/Basalt/getFrame.md)|Returns a frame object by it's id |[getFrame](objects/Basalt/getFrame.md)|Returns a frame object by it's id
|[getActiveFrame](objects/Basalt/getActiveFrame.md)|Returns the currently active base frame |[getActiveFrame](objects/Basalt/getActiveFrame.md)|Returns the currently active base frame
|[autoUpdate](objects/Basalt/autoUpdate.md)|Starts the event and draw listener |[getTheme](objects/Basalt/getTheme.md)|Returns the currently active theme
|[update](objects/Basalt/update.md)|Starts the event and draw listener once |[getVariable](objects/Basalt/getVariable.md)|Returns a variable defined with setVariable
|[stopUpdate](objects/Basalt/stopUpdate.md)|Stops the currently active event and draw listener |[getVersion](objects/Basalt/getVersion.md)|Returns the Basalt version
|[isKeyDown](objects/Basalt/isKeyDown.md)|Returns if the key is held down |[isKeyDown](objects/Basalt/isKeyDown.md)|Returns if the key is held down
|[debug](objects/Basalt/debug.md)|Writes something into the debug console
|[log](objects/Basalt/log.md)|Writes something into the log file |[log](objects/Basalt/log.md)|Writes something into the log file
|[onEvent](objects/Basalt/onEvent.md)|Event listener
|[removeFrame](objects/Basalt/removeFrame.md)|Removes a previously created base frame
|[schedule](objects/Basalt/schedule.md)|Schedules a new task
|[setActiveFrame](objects/Basalt/setActiveFrame.md)|Sets the active frame
|[setTheme](objects/Basalt/setTheme.md)|Changes the base theme of basalt |[setTheme](objects/Basalt/setTheme.md)|Changes the base theme of basalt
|[setVariable](objects/Basalt/setVariable.md)|Sets a variable which you can access via XML |[setVariable](objects/Basalt/setVariable.md)|Sets a variable which you can access via XML
|[schedule](objects/Basalt/schedule.md)|Schedules a new task |[stopUpdate](objects/Basalt/stopUpdate.md)|Stops the currently active event and draw listener
|[update](objects/Basalt/update.md)|Starts the event and draw listener once
# Examples ## Examples
Here is a lua example on how to create a empty base frame and start basalt's listener. Here is a lua example on how to create a empty base frame and start basalt's listener.
```lua ```lua
local basalt = require("basalt") -- we load the UI Framework into our project local basalt = require("basalt") -- Loads Basalt into our project
local main = basalt.createFrame() -- we create a base frame - on that frame we are able to add object's local main = basalt.createFrame() -- Creates a base frame. On that frame we are able to add object's
-- here we would add additional object's -- Here we would add additional object's
basalt.autoUpdate() -- we start listening to incoming events and draw stuff on the screen basalt.autoUpdate() -- Starts listening to incoming events and draw stuff on the screen. This should nearly always be the last line.
``` ```