Skip to content

TextLabel

Text on screen.

  • Inherits: GuiObject → Instance
  • Subclasses: TextBox, TextButton
  • Creatable: Yes: new TextLabel(), or Instance.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.

Type: string · Default: 'Label' · Access: read/write · Replicates: yes

The text shown, as plain text.

Type: Color3 · Default: Color3.fromHex('#0b1b36') · Access: read/write · Replicates: yes

Color of the text.

Type: number · Default: 18 · Range: 6 to 200 (clamped) · Access: read/write · Replicates: yes

Font size, in pixels.

Type: 'normal' | 'medium' | 'bold' · Default: 'medium' · Access: read/write · Replicates: yes

How bold the text is.

Type: 'left' | 'center' | 'right' · Default: 'center' · Access: read/write · Replicates: yes

Horizontal alignment of the text.

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

Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString

Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged

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();
});