Updated Label (markdown)
20
Label.md
20
Label.md
@@ -1,21 +1,13 @@
|
|||||||
FYI: The label is currently a one liner, i will improve the label to be a multiliner. one of my TODOs<br><br>
|
With labels you are able to add simple text to the screen.<br><br>
|
||||||
Labels are objects, where you are able to put some text onto the screen.
|
|
||||||
Here is a example of how to create a default Label:
|
|
||||||
|
|
||||||
````lua
|
Here are all possible functions available for labels: <br>
|
||||||
local mainFrame = CreateFrame("myFirstFrame"):show()
|
Remember label also inherits from [object](https://github.com/NoryiE/Basalt/wiki/Object)
|
||||||
local aInput = mainFrame:addLabel("myFirstLabel"):show()
|
|
||||||
````
|
|
||||||
|
|
||||||
This will create a default label with a size 1 width and 1 height on position 1 1 (relative to its parent frame), the default background is the parent background, the default text color is also the parent text color and the default zIndex is 1.
|
|
||||||
|
|
||||||
Here are all possible functions available for labels. Remember label inherit from [object](https://github.com/NoryiE/NyoUI/wiki/Object):
|
|
||||||
|
|
||||||
## setText
|
## 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
|
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
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = CreateFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aLabel = mainFrame:addLabel("myFirstLabel"):setText("I am a label!"):show()
|
local aLabel = mainFrame:addLabel("myFirstLabel"):setText("I am a label!"):show()
|
||||||
````
|
````
|
||||||
**args:** some text<br>
|
**args:** string text<br>
|
||||||
**returns:** the object<br>
|
**returns:** self<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user