Updated Label (markdown)

Robert Jelic
2022-05-02 21:56:14 +02:00
parent 5b88153fcb
commit 08da2c641a

@@ -1,13 +1,42 @@
With labels you are able to add simple text to the screen.<br><br>
With sliders you can add a object where the user can change a number value.<br><br>
Here are all possible functions available for labels: <br>
Remember label also inherits from [object](https://github.com/NoryiE/Basalt/wiki/Object)
Here are all possible functions available for sliders: <br>
Remember slider also inherits from [object](https://github.com/NoryiE/Basalt/wiki/Object)
## setText
sets the text of your label, it automatically adjusts the width to the text len. If you by any chance dont want the width to be able to change, use :setValue() instead
## setSymbol
this will change the foreground symbol
````lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aLabel = mainFrame:addLabel("myFirstLabel"):setText("I am a label!"):show()
local aSlider = mainFrame:addSlider("myFirstSlider"):setSymbol("X"):show()
````
**parameters:** string text<br>
**parameters:** char symbol<br>
**returns:** self<br>
## setBackgroundSymbol
this will change the symbol background color
````lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aSlider = mainFrame:addSlider("myFirstSlider"):setBackgroundSymbol(colors.yellow):show()
````
**parameters:** number color<br>
**returns:** self<br>
## setSymbolColor
this will change the symbol color
````lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aSlider = mainFrame:addSlider("myFirstSlider"):setSymbolColor(colors.red):show()
````
**parameters:** number color<br>
**returns:** self<br>
## setBarType
this will change the bar to vertical/horizontal (default is horizontal)
````lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aSlider = mainFrame:addSlider("myFirstSlider"):setBarType("vertical"):show()
````
**parameters:** string value ("vertical", "horizontal"<br>
**returns:** self<br>