Update Basalt.md
This commit is contained in:
@@ -78,6 +78,13 @@ Calls the draw and event handler once - this gives more flexibility about which
|
|||||||
|
|
||||||
#### Usage:
|
#### Usage:
|
||||||
* Creates and starts a custom update cycle
|
* Creates and starts a custom update cycle
|
||||||
|
```lua
|
||||||
|
local mainFrame = basalt.createFrame()
|
||||||
|
local aButton = mainFrame:addButton():setPosition(2,2)
|
||||||
|
while true do
|
||||||
|
basalt.update(os.pullEventRaw())
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
## basalt.stopUpdate
|
## basalt.stopUpdate
|
||||||
Stops the automatic draw and event handler which got started by basalt.autoUpdate()
|
Stops the automatic draw and event handler which got started by basalt.autoUpdate()
|
||||||
@@ -104,7 +111,14 @@ Checks if the user is currently holding a key
|
|||||||
|
|
||||||
#### Usage:
|
#### Usage:
|
||||||
* Shows a debug message with true or false if the left ctrl key is down, as soon as you click on the button.
|
* Shows a debug message with true or false if the left ctrl key is down, as soon as you click on the button.
|
||||||
|
```lua
|
||||||
|
local mainFrame = basalt.createFrame()
|
||||||
|
local aButton = mainFrame:addButton():setPosition(2,2):setText("Check Ctrl")
|
||||||
|
aButton:onClick(function()
|
||||||
|
basalt.debug(basalt.isKeyDown(keys.leftCtrl))
|
||||||
|
end)
|
||||||
|
basalt.autoUpdate()
|
||||||
|
```
|
||||||
|
|
||||||
## basalt.debug
|
## basalt.debug
|
||||||
creates a label with some information on the main frame on the bottom left, if you click on that label it will open a log view for you. See it as the new print for debugging
|
creates a label with some information on the main frame on the bottom left, if you click on that label it will open a log view for you. See it as the new print for debugging
|
||||||
|
|||||||
Reference in New Issue
Block a user