diff --git a/docs/objects/Basalt.md b/docs/objects/Basalt.md index 6562404..e095382 100644 --- a/docs/objects/Basalt.md +++ b/docs/objects/Basalt.md @@ -78,6 +78,13 @@ Calls the draw and event handler once - this gives more flexibility about which #### Usage: * 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 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: * 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 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