The master branch was reverted to 1.7 because it was very unstable (bugs and stuff that wasn't mentioned on the documentation page yet) - features will come back with 2.0 - fixed debug window - fixed flexbox not sending drag events to it's children - small docs updates for 1.7 - removed the examples because the are outdated
1.0 KiB
1.0 KiB
A Label object is used to display simple text on the interface.
In addition to the Object and VisualObject methods, Label objects have the following methods:
| setText | Sets the input type |
| setFontSize | Returns the input type |
| getFontSize | Sets the default text |
| setTextAlign | Changes the horizontal text align |
By default, a label's width is auto-sized based on the length of the text. If you change the size with setSize, it will automatically stop auto-sizing the width.
The fontsize feature is calculated by bigfonts, a library made by Wojbie (http://www.computercraft.info/forums2/index.php?/topic/25367-bigfont-api-write-bigger-letters-v10/)
Here's an example of how to create a Label object and set its properties:
Lua:
local main = basalt.createFrame()
local aLabel = main:addLabel()
aLabel:setText("Hello, World!")
aLabel:setFontSize(2)
XML:
<label text="Hello World!" fontSize="2" />