Skip to Content
Kinemium

TextLabel

Render a block of text in a user interface.

TextLabel draws text inside a GUI layout. It exposes the text, font, color, stroke, wrapping, scaling, and alignment properties, and inherits everything from GuiObject.

Getting started

local label = Instance.new("TextLabel")
label.Size = UDim2.fromOffset(240, 48)
label.Position = UDim2.fromOffset(20, 20)
label.BackgroundTransparency = 1
label.Text = "Wave 3"
label.TextSize = 24
label.TextColor3 = Color3.fromRGB(255, 255, 255)
label.Parent = screenGui

Text properties

PropertyTypeAccessDescription
TextstringRead/writeThe displayed string.
FontEnum.FontRead/writeLegacy font selector.
FontFaceFontRead/writeFont object, including family and weight.
FontSizeEnum.FontSizeRead/writeNamed size preset.
TextSizenumberRead/writeSize in pixels.
TextColor3Color3Read/writeFill color.
TextTransparencynumberRead/writeFill transparency.
TextStrokeColor3Color3Read/writeOutline color.
TextStrokeTransparencynumberRead/writeOutline transparency.
TextStrokeThicknessnumberRead/writeOutline width.
TextWrappedbooleanRead/writeWrap long lines to the label width.
TextScaledbooleanRead/writeScale text to fill the label.
TextXAlignmentEnum.TextXAlignmentRead/writeHorizontal alignment.
TextYAlignmentEnum.TextYAlignmentRead/writeVertical alignment.
LineHeightnumberRead/writeLine spacing multiplier.
TextPaddingnumberRead/writeInner padding in pixels.
RichTextbooleanRead/writeParse inline rich text tags.
TruncateAtEndbooleanRead/writeCut off text that doesn't fit.
TextBoundsVector2Read-onlyMeasured size of the laid-out text.

Font and FontFace are two views of the same setting. Assigning a Font keeps the legacy enum; assigning a FontFace stores the font object. FontSize maps to the nearest named preset, while TextSize sets the pixel size directly.

Alignment

TextXAlignment accepts Left, Center, and Right. TextYAlignment accepts Top, Center, and Bottom. The defaults are centered on both axes.

label.TextXAlignment = Enum.TextXAlignment.Left
label.TextYAlignment = Enum.TextYAlignment.Top

Notes

  • TextScaled takes precedence over TextSize when it's enabled.
  • TextBounds is updated after layout and is meant for reading, not for sizing the label.
  • Rich text tags are only parsed when RichText is true.
  • Inherits Visible, Size, Position, AnchorPoint, BackgroundColor3, ZIndex, and the other GuiObject members.

See also

  • TextButton for a clickable version.
  • TextBox for editable text.
  • GuiObject for layout and appearance.

On this page