Some docs updates

This commit is contained in:
Robert Jelic
2022-08-30 20:49:25 +02:00
parent c977410a41
commit 2dd3bf648b
22 changed files with 181 additions and 131 deletions

View File

@@ -41,3 +41,24 @@ local button2 = main:addButton()
basalt.autoUpdate()
```
Also very interesting is a button where you are able to resize the frame just by dragging the button.
```lua
local basalt = require("basalt")
local main = basalt.createFrame()
local sub = main:addFrame():setSize(30,12):setMovable()
sub:addLabel():setText("Example Frame"):setSize("parent.w", 1):setBackground(colors.black):setForeground(colors.lightGray)
local dragButton = sub:addButton()
:setAnchor("bottomRight")
:setPosition(1,1)
:setSize(1,1)
:setText("/")
:onDrag(function(self, button, x, y, xOffset, yOffset)
sub:setSize(-xOffset, -yOffset, true)
end)
basalt.autoUpdate()
```