Updated Label (markdown)
43
Label.md
43
Label.md
@@ -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>
|
Here are all possible functions available for sliders: <br>
|
||||||
Remember label also inherits from [object](https://github.com/NoryiE/Basalt/wiki/Object)
|
Remember slider also inherits from [object](https://github.com/NoryiE/Basalt/wiki/Object)
|
||||||
|
|
||||||
## setText
|
## setSymbol
|
||||||
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
|
this will change the foreground symbol
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
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>
|
**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>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user