updated docs

This commit is contained in:
Samkist
2022-05-30 02:23:40 -04:00
parent 2a8817df96
commit e5bc39a6f7
51 changed files with 1673 additions and 3347 deletions

View File

@@ -1,25 +1,24 @@
# Button
Buttons are objects, which execute function by clicking on them
The following list is only available to buttons: <br>
Remember button also inherits from [object](/objects/Object):
## setText
Sets the displayed button text
````lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() -- you could also use :setValue() instead of :setText() - no difference
````
**Arguments:** string text<br>
**returns:** self<br>
## Examples
Add a onClick event:
````lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):onClick(function(self,event,button,x,y)
if(event=="mouse_click")and(button==1)then
basalt.debug("Left mousebutton got clicked!")
end
end):show()
Buttons are objects, which execute function by clicking on them
The following list is only available to buttons: <br>
Remember button also inherits from [object](https://github.com/NoryiE/basalt/wiki/Object):
## setText
Sets the displayed button text
````lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() -- you could also use :setValue() instead of :setText() - no difference
````
**Arguments:** string text<br>
**returns:** self<br>
# Examples
Add a onClick event:
````lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):onClick(function(self,event,button,x,y)
if(event=="mouse_click")and(button==1)then
basalt.debug("Left mousebutton got clicked!")
end
end):show()
````