We use cookies on this site to enhance your user experience

A TextLabel renders a rectangle, like a Frame, with styled text. The rectangle can be used to define text boundaries, text scaling (TextLabel/TextScaled) and wrapping (TextLabel/TextWrapped, TextLabel/TextXAlignment, TextLabel/TextYAlignment).

This class contains properties that control the display of the text, such as TextLabel/Font and TextLabel/TextColor3. All text rendered by a single text label will have the same visual properties; multiple TextLabel objects must be used in order to render multiple styles of text. To display only text and hide the rectangle, set GuiObject/BackgroundTransparency to 1.

TextService/GetTextSize can be used to get the size (bounds) of text that would be rendered in a TextLabel given a font size, font, and frame size.

A UITextSizeConstraint object can be used to constrain the size of text with TextLabel/TextScaled enabled.

Properties

Name Type Description
Font

Determines the font used to render text.

float

Scales the spacing between lines of text in the TextLabel.

string

Sets whether a TextLabel should be GuiBase2d/Localize or not.

string

Determines the string rendered by the UI element.

Vector2

The pixel size of a UI element’s text.

Color3

Determines the color of rendered text.

bool

Enables when rendered text content does not fit within the UI element’s space.

bool

Determines whether text in a UI element is scaled to fill the UI element.

float

Determine the line height of text in pixels.

Color3

Determines the color of the text stroke (outline).

float

Determines the transparency of the text stroke (outline).

float

Determines the transparency of rendered text.

TextTruncate

Controls the truncation of the text displayed in this TextLabel.

bool

Determines if text wraps to multiple lines within the UI element space, truncating excess text.

TextXAlignment

Determines the horizontal alignment of rendered text.

TextYAlignment

Determines the vertical alignment of rendered text.

Inherited from Instance , GuiBase , GuiBase2d , GuiObject , GuiLabel

Archivable ClassName DataCost Name Parent RobloxLocked AbsolutePosition AbsoluteRotation AbsoluteSize AutoLocalize RootLocalizationTable Active AnchorPoint BackgroundColor3 BackgroundTransparency BorderColor3 BorderSizePixel ClipsDescendants LayoutOrder NextSelectionDown NextSelectionLeft NextSelectionRight NextSelectionUp Position Rotation Selectable SelectionImageObject Size SizeConstraint Transparency Visible ZIndex