Label
Labels are used to display text.
Playground
[<font color="rgb(73, 230, 133)">Obsidian</font>] every text component (ex: Notification Title, Descriptions, etc.) supports <b>Rich Text</b> by default!
Usage
You can create a Label by calling the AddLabel method on a Groupbox.
Choose between positional arguments for quick calls or a configuration table for more readability.
Positional Arguments
local Label = Groupbox:AddLabel("This is a label", false)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Text of the label | string | nil |
| 2 | Whether to wrap the text | boolean | true |
| 3 | Index/ID of the label | string | nil |
or
Configuration Table
local LabelOptions = {
Text = "This is a label",
DoesWrap = false
}
local Label = Groupbox:AddLabel(LabelOptions)
-- or local Label = Groupbox:AddLabel("MyLabel", LabelOptions)
-- which allows you to do: Library.Labels.MyLabel:SetText("This is a label")Prop
Type
Methods
You can use the following methods to interact with the label:
SetText
Sets the text of the label.
Label:SetText(text)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Text of the label | string | nil |
SetSize
Sets the size of the label.
Label:SetSize(size)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Size of the label | number | nil |
SetVisible
Shows or hides the label.
Label:SetVisible(boolean)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Whether to show the label | boolean | nil |