Open Asterune
TextLabel

TextLabel

Displays text within a GUI rectangle.

Creatable
Instance.new("TextLabel")
Inherits
GuiLabelGuiObjectGuiBase2dGuiBaseInstance
Replication
Standard

Behavior

TextLabel displays text and supports background, layout, and text formatting properties. Use TextButton for button activation.

Set BackgroundTransparency to 1 to hide the label background.

Summary

Members72
Properties57
Methods3
Events12

Properties

AbsolutePosition

TextLabel.AbsolutePosition: Vector2 = Vector2.new(0, 0)

The resolved top-left position of this interface element in pixels.

AbsoluteRotation

TextLabel.AbsoluteRotation: number = 0

The resolved rotation of this interface element in degrees, including ancestor rotation.

AbsoluteSize

TextLabel.AbsoluteSize: Vector2 = Vector2.new(0, 0)

The resolved width and height of this interface element in pixels.

Active

TextLabel.Active: boolean = false

Whether this interface accepts and consumes input.

AnchorPoint

TextLabel.AnchorPoint: Vector2 = Vector2.new(0, 0)

The normalized point within the element used as the origin for Position. (0, 0) is the top-left corner; (0.5, 0.5) is the center.

AutomaticSize

TextLabel.AutomaticSize: Enum.AutomaticSize = Enum.AutomaticSize.None

The dimensions that resize to fit the element's content.

BackgroundColor3

TextLabel.BackgroundColor3: Color3 = Color3.new(0.6392157, 0.63529414, 0.64705884)

The color used to fill the element's background.

BackgroundTransparency

TextLabel.BackgroundTransparency: number = 0

The background transparency, from 0 for opaque to 1 for invisible.

BorderColor3

TextLabel.BorderColor3: Color3 = Color3.new(0.105882354, 0.16470589, 0.20784314)

The color of the element's border.

BorderMode

Whether the border is drawn outside, across, or inside the element's bounds.

BorderSizePixel

TextLabel.BorderSizePixel: number = 1

The border thickness in pixels.

ClipsDescendants

TextLabel.ClipsDescendants: boolean = false

Whether descendant rendering is clipped to this element's bounds.

ContentText

TextLabel.ContentText: string

The text content after rich-text markup has been removed. Read-only.

CornerRadius

TextLabel.CornerRadius: number = 0

The corner radius used for the element's rounded background.

Corners

TextLabel.Corners: { number } = {}

The individual corner radii used for the element's rounded background.

Draggable

TextLabel.Draggable: boolean = false

Whether pointer dragging can move the element.

FontFace

TextLabel.FontFace: Font = ""

The typeface used to render text. FontStyle and FontWeight configure style and weight.

FontMono

TextLabel.FontMono: boolean

Whether the text uses the monospaced font option.

FontStyle

TextLabel.FontStyle: Enum.FontStyle = Enum.FontStyle.Normal

The style applied to the text, such as normal or italic.

FontWeight

The weight applied to the text, such as regular or bold.

Grow

TextLabel.Grow: number = 0

The share of remaining main-axis space assigned to this child in flow layout.

GuiState

TextLabel.GuiState: Enum.GuiState = Enum.GuiState.Idle

The element's current idle, hover, pressed, or non-interactable state.

InputSink

TextLabel.InputSink: Enum.InputSink = Enum.InputSink.None

Which input events this element consumes before they reach elements behind it.

Interactable

TextLabel.Interactable: boolean = true

Whether the element accepts interaction.

Layout

TextLabel.Layout: Enum.Layout = Enum.Layout.Flow

Whether children use flow layout or their explicit positions.

LayoutOrder

TextLabel.LayoutOrder: number = 0

The numeric order of this element when a parent layout sorts by layout order.

LetterSpacing

TextLabel.LetterSpacing: number

The additional spacing between text glyphs.

LineHeight

TextLabel.LineHeight: number

The line-height multiplier used for multi-line text.

MaxVisibleGraphemes

TextLabel.MaxVisibleGraphemes: number

The maximum number of visible graphemes. Set to a negative value to show all graphemes.

NextSelectionDown

TextLabel.NextSelectionDown: GuiObject? = nil

The interface element selected when navigating down from this element.

NextSelectionLeft

TextLabel.NextSelectionLeft: GuiObject? = nil

The interface element selected when navigating left from this element.

NextSelectionRight

TextLabel.NextSelectionRight: GuiObject? = nil

The interface element selected when navigating right from this element.

NextSelectionUp

TextLabel.NextSelectionUp: GuiObject? = nil

The interface element selected when navigating up from this element.

Opacity

TextLabel.Opacity: number = 1

The opacity multiplier applied to this element and its descendants.

Position

TextLabel.Position: UDim2 = UDim2.new(0, 0, 0, 0)

The element position relative to its parent. Scale components use the parent size; offsets are in pixels.

RichText

TextLabel.RichText: boolean

Whether markup in Text is parsed and rendered as rich text.

Rotation

TextLabel.Rotation: number = 0

The interface rotation in degrees.

Selectable

TextLabel.Selectable: boolean = false

Whether interface navigation can select this element.

SelectionImageObject

TextLabel.SelectionImageObject: GuiObject? = nil

The interface element used to draw the selection indicator.

SelectionOrder

TextLabel.SelectionOrder: number = 0

The numeric order used for interface selection traversal.

Size

TextLabel.Size: UDim2 = UDim2.new(0, 0, 0, 0)

The element size relative to its parent. Scale components use the parent size; offsets are in pixels.

SizeConstraint

The parent axes used to resolve relative interface size.

Text

TextLabel.Text: string = "Label"

The displayed string. Assignment updates the text layout.

TextBounds

TextLabel.TextBounds: Vector2

The resolved pixel bounds of the rendered text. Read-only.

TextColor3

TextLabel.TextColor3: Color3 = Color3.new(0, 0, 0)

The text color.

TextFits

TextLabel.TextFits: boolean

Whether the rendered text fits within the label's bounds. Read-only.

TextScaled

TextLabel.TextScaled: boolean

Whether the engine scales the text to fit the label's bounds.

TextSize

TextLabel.TextSize: number = 8

The base text size in pixels.

TextStrokeColor3

TextLabel.TextStrokeColor3: Color3 = Color3.new(0, 0, 0)

The color of the outline around each glyph.

TextStrokeTransparency

TextLabel.TextStrokeTransparency: number = 1

The outline transparency. Defaults to fully transparent. Reduce this value to display the outline.

TextTransparency

TextLabel.TextTransparency: number = 0

The text transparency. This is independent of BackgroundTransparency.

TextTruncate

TextLabel.TextTruncate: EnumItem

The truncation mode used when text does not fit.

TextWrapped

TextLabel.TextWrapped: boolean = false

Whether text wraps onto additional lines when it exceeds the label width.

TextXAlignment

The horizontal alignment within the label. See Enum.TextXAlignment.

TextYAlignment

The vertical alignment within the label.

Visible

TextLabel.Visible: boolean = true

Whether this interface element is rendered.

ZIndex

TextLabel.ZIndex: number = 1

The element's draw-order index. Interpretation depends on the root's ZIndexBehavior.

Methods

CaptureFocus

TextLabel:CaptureFocus(): ()

Gives keyboard focus to this interface element.

GetExecutionGroup

TextLabel:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

ReleaseFocus

TextLabel:ReleaseFocus(): ()

Removes keyboard focus from this interface element.

Events

DragBegin

TextLabel.DragBegin: RBXScriptSignal

Fires when pointer dragging of the element begins.

DragStopped

TextLabel.DragStopped: RBXScriptSignal

Fires when pointer dragging of the element ends.

InputBegan

TextLabel.InputBegan: RBXScriptSignal

Fires when input begins over or is dispatched to this interface element.

InputChanged

TextLabel.InputChanged: RBXScriptSignal

Fires when input dispatched to this element changes.

InputEnded

TextLabel.InputEnded: RBXScriptSignal

Fires when input dispatched to this element ends.

MouseWheelBackward

TextLabel.MouseWheelBackward: RBXScriptSignal

Fires when the mouse wheel scrolls backward over this element.

MouseWheelForward

TextLabel.MouseWheelForward: RBXScriptSignal

Fires when the mouse wheel scrolls forward over this element.

PointerEntered

TextLabel.PointerEntered: RBXScriptSignal

Fires when a pointer moves onto the label.

PointerExited

TextLabel.PointerExited: RBXScriptSignal

Fires when a pointer moves off the label.

PointerMoved

TextLabel.PointerMoved: RBXScriptSignal

Fires when the pointer moves across the label.

SelectionGained

TextLabel.SelectionGained: RBXScriptSignal

Fires when interface navigation selects this element.

SelectionLost

TextLabel.SelectionLost: RBXScriptSignal

Fires when this element loses interface selection.

Inherited members

Inherited48

Example

Luau
local label = Instance.new("TextLabel")
label.Text = "Score: 0"
label.BackgroundTransparency = 1

TextButton · Frame · Enum.TextXAlignment