Docs update, mostly Basalt, Sidebar and Footer. #28

Merged
piprett merged 30 commits from master into master 2022-09-17 21:04:41 +08:00
Showing only changes of commit bd61da9593 - Show all commits

View File

@@ -1,18 +1,23 @@
## basalt.update
# basalt.update
Calls the draw and event handler once - this gives more flexibility about which events basalt should process. For example you could filter the terminate event. Calls the draw and event handler once - this gives more flexibility about which events basalt should process. For example you could filter the terminate event.
Which means you have to pass the events into basalt.update. Which means you have to pass the events into basalt.update.
#### Parameters: ## Parameters
1. `string` The event to be received
1. `string` The event to be received
2. `...` Additional event variables to capture 2. `...` Additional event variables to capture
#### Usage: ## Usage
* Creates and starts a custom update cycle * Creates and starts a custom update cycle
```lua ```lua
local mainFrame = basalt.createFrame() local mainFrame = basalt.createFrame()
local aButton = mainFrame:addButton():setPosition(2,2) mainFrame:addButton():setPosition(2,2)
while true do while true do
local ev = table.pack(os.pullEventRaw()) local ev = table.pack(os.pullEventRaw())
basalt.update(table.unpack(ev)) basalt.update(table.unpack(ev))
end end
``` ```