Docs 1.6
Accidentally uploaded outdated 1.6 docs
This commit is contained in:
23
docs/docs1_6/objects/Object/onResize.md
Normal file
23
docs/docs1_6/objects/Object/onResize.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Object - Event
|
||||
|
||||
## onResize
|
||||
|
||||
`onResize(self)`
|
||||
|
||||
This is a custom event which gets triggered as soon as the parent frame gets resized.
|
||||
|
||||
Here is a example on how to add a onResize event to your button:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local main = basalt.createFrame()
|
||||
local aButton = main:addButton():setPosition(3,3)
|
||||
|
||||
local function onButtonResize(self)
|
||||
local width = main:getWidth()
|
||||
self:setSize(width, 3)
|
||||
end
|
||||
|
||||
aButton:onResize(onButtonResize)
|
||||
```
|
||||
Reference in New Issue
Block a user