TextLabel
Text on screen.
- Inherits: GuiObject → Instance
- Subclasses: TextBox, TextButton
- Creatable: Yes:
new TextLabel(), orInstance.new('TextLabel', parent). - Replication: Replicated: clients get a copy, and changes the server makes reach them.
A TextLabel is a GuiObject that shows plain text. Like other GUI
objects it has an opaque white background by default: set backgroundTransparency to 1 to show
only the text.
Properties
Section titled “Properties”Type: string · Default: 'Label' · Access: read/write · Replicates: yes
The text shown, as plain text.
textColor
Section titled “textColor”Type: Color3 · Default: Color3.fromHex('#0b1b36') · Access: read/write · Replicates: yes
Color of the text.
textSize
Section titled “textSize”Type: number · Default: 18 · Range: 6 to 200 (clamped) · Access: read/write · Replicates: yes
Font size, in pixels.
fontWeight
Section titled “fontWeight”Type: 'normal' | 'medium' | 'bold' · Default: 'medium' · Access: read/write · Replicates: yes
How bold the text is.
textAlign
Section titled “textAlign”Type: 'left' | 'center' | 'right' · Default: 'center' · Access: read/write · Replicates: yes
Horizontal alignment of the text.
textWrapped
Section titled “textWrapped”Type: boolean · Default: true · Access: read/write · Replicates: yes
When true, long text wraps onto more lines; when false it stays on one line.
Inherited from GuiObject: position, positionScale, size, sizeScale, anchorPoint, backgroundColor, backgroundTransparency, cornerRadius, visible, zIndex
Inherited from Instance: name, archivable, id, className, parent, destroyed
Methods
Section titled “Methods”Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString
Events
Section titled “Events”Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged
Examples
Section titled “Examples”Show the round status
Section titled “Show the round status”import { PlayerGui, ReplicatedStorage, ScreenGui, StringValue, TextLabel, task, waitForChild, waitForLocalPlayer,} from '@rally/sdk';
// LocalScript: show the status a server script keeps in ReplicatedStorage.task.spawn(async () => { const me = await waitForLocalPlayer(); const hud = await waitForChild(await waitForChild(me, 'PlayerGui', PlayerGui), 'HUD', ScreenGui); const label = await waitForChild(hud, 'Status', TextLabel); const status = await waitForChild(ReplicatedStorage, 'Status', StringValue); const show = () => { label.text = status.value; }; status.getPropertyChangedSignal('value').connect(show); show();});