-
Notifications
You must be signed in to change notification settings - Fork 0
Label
Nibbl-z edited this page Aug 10, 2024
·
1 revision
Labels are UI elements that contain text. You can change the font, text size, alignment, and color.
To create a Label, call yan:Label(screen, text, textSize, horizontalAlignment, verticalAlignment, fontPath). This will return a Label instance.
The screen to put the Label under.
The text to put in the Label.
The size of the text.
The alignment of the text on the X axis.
The alignment of the text on the Y axis.
The path of the font to use on the Label.
The text to put in the Label.
The alignment of the text on the X axis.
The alignment of the text on the Y axis.
Note: Text Size and Font cannot be changed after creation as of now.
local label1 = yan:Label(MainMenu, "Hello Yan!", 32, "center", "center")
local label2 = yan:Label(MainMenu, "I love music!", 16, "left", "top")
label2.Text = "I love the stars!"