diff --git a/docs/guides/getting-started.md b/docs/guides/getting-started.md index 67b709c..7ba6820 100644 --- a/docs/guides/getting-started.md +++ b/docs/guides/getting-started.md @@ -76,6 +76,30 @@ element:onChange(function(self, value) end) ``` +## Using monitors instead + +Basalt can render to monitors instead of the terminal. Here's how to use monitors: + +```lua +local basalt = require("basalt") + +-- Get a reference to the monitor +local monitor = peripheral.find("monitor") +-- Or specific side: peripheral.wrap("right") + +-- Create frame for monitor +local monitorFrame = basalt.createFrame():setTerm(monitor) -- :setTerm is the important method here + +-- Add elements like normal +monitorFrame:addButton() + :setText("Monitor Button") + :setWidth(24) + :setPosition(2, 2) + +-- Start Basalt +basalt.run() +``` + ## Next Steps - Check out the [Examples](https://github.com/Pyroxenium/Basalt2/tree/main/examples) for more complex UIs