# TextLabel

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [GuiLabel](https://rapi.sleaze.dev/classes/GuiLabel.md), [GuiObject](https://rapi.sleaze.dev/classes/GuiObject.md), [GuiBase2d](https://rapi.sleaze.dev/classes/GuiBase2d.md), [GuiBase](https://rapi.sleaze.dev/classes/GuiBase.md), [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Memory category: Gui
- HTML page: https://rapi.sleaze.dev/classes/TextLabel/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/TextLabel

A 2D user interface element that displays non-interactive text.

## Properties

### Confidential

```luau
TextLabel.Confidential: boolean = false
```

- Tags: Hidden, Not replicated, Not scriptable, Roblox engine security, Read capabilities: UI

### LocalizedText

```luau
TextLabel.LocalizedText: string = ""
```

- Tags: Hidden, Read only, Read capabilities: UI, Save only

Read-only string containing the automatically-localized text that the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md) renders.

### ContentText

```luau
TextLabel.ContentText: string = "Label"
```

- Tags: Read only, Read capabilities: UI

A copy of [`TextLabel.Text`](https://rapi.sleaze.dev/classes/TextLabel.md) that contains exactly what is being rendered by the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md).

### Font

```luau
TextLabel.Font: Enum.Font = Enum.Font.Legacy
```

- Tags: Hidden, Not replicated, Read capabilities: UI, Load only

Determines the font used to render text.

### FontFace

```luau
TextLabel.FontFace: Font
```

- Tags: Read capabilities: UI

Determines the font used to render text.

### LineHeight

```luau
TextLabel.LineHeight: number = 1
```

- Tags: Read capabilities: UI

Scales the spacing between lines of text in the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md).

### LocalizationMatchedSourceText

```luau
TextLabel.LocalizationMatchedSourceText: string = ""
```

- Tags: Hidden, Not replicated, Roblox script security, Read capabilities: UI

### LocalizationMatchIdentifier

```luau
TextLabel.LocalizationMatchIdentifier: string = ""
```

- Tags: Hidden, Not replicated, Roblox script security, Read capabilities: UI

### MaxVisibleGraphemes

```luau
TextLabel.MaxVisibleGraphemes: number = -1
```

- Tags: Read capabilities: UI

The maximum number of graphemes the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md) can show.

### OpenTypeFeatures

```luau
TextLabel.OpenTypeFeatures: string = ""
```

- Tags: Read capabilities: UI

Applies OpenType typographic features to the text rendered by the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md).

### OpenTypeFeaturesError

```luau
TextLabel.OpenTypeFeaturesError: string = ""
```

- Tags: Read only, Read capabilities: UI, Save only

Read-only property that describes why the [`TextLabel.OpenTypeFeatures`](https://rapi.sleaze.dev/classes/TextLabel.md) string could not be applied.

### RichText

```luau
TextLabel.RichText: boolean = false
```

- Tags: Read capabilities: UI

Determines whether the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md) renders its text using rich text formatting.

### Text

```luau
TextLabel.Text: string = "Label"
```

- Tags: Read capabilities: UI

Determines the string rendered by the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md).

### TextBounds

```luau
TextLabel.TextBounds: Vector2 = Vector2.zero
```

- Tags: Read only, Read capabilities: UI

Read-only property which reflects the absolute size of rendered text in

### TextColor3

```luau
TextLabel.TextColor3: Color3 = Color3.new(0.105882, 0.164706, 0.207843)
```

- Tags: Read capabilities: UI

Determines the color of rendered text.

### TextDirection

```luau
TextLabel.TextDirection: Enum.TextDirection = Enum.TextDirection.Auto
```

- Tags: Read capabilities: UI

Direction in which the text is rendered.

### TextFits

```luau
TextLabel.TextFits: boolean = false
```

- Tags: Read only, Read capabilities: UI

A boolean representation of whether the label's text fits within the size of it.

### TextScaled

```luau
TextLabel.TextScaled: boolean = false
```

- Tags: Read capabilities: UI

Changes whether text is resized to fit within the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md).

### TextSize

```luau
TextLabel.TextSize: number = 8
```

- Tags: Read capabilities: UI

Determines the line height of text in offsets.

### TextStrokeColor3

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

- Tags: Read capabilities: UI

Determines the color of the text stroke (outline).

### TextStrokeTransparency

```luau
TextLabel.TextStrokeTransparency: number = 1
```

- Tags: Read capabilities: UI

Determines the transparency of the text stroke (outline).

### TextTransparency

```luau
TextLabel.TextTransparency: number = 0
```

- Tags: Read capabilities: UI

Determines the transparency of rendered text.

### TextTruncate

```luau
TextLabel.TextTruncate: Enum.TextTruncate = Enum.TextTruncate.None
```

- Tags: Read capabilities: UI

Controls the truncation of the text displayed in the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md).

### TextWrapped

```luau
TextLabel.TextWrapped: boolean = false
```

- Tags: Read capabilities: UI

Determines if text wraps to multiple lines within the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md)

### TextXAlignment

```luau
TextLabel.TextXAlignment: Enum.TextXAlignment = Enum.TextXAlignment.Center
```

- Tags: Read capabilities: UI

Determines the horizontal alignment of rendered text.

### TextYAlignment

```luau
TextLabel.TextYAlignment: Enum.TextYAlignment = Enum.TextYAlignment.Center
```

- Tags: Read capabilities: UI

Determines the vertical alignment of rendered text.

### FontSize

```luau
TextLabel.FontSize: Enum.FontSize = Enum.FontSize.Size8
```

- Tags: Deprecated, Not replicated, Read capabilities: UI, Load only
- Use instead: [`TextLabel.TextSize`](https://rapi.sleaze.dev/classes/TextLabel.md)

**Deprecated:** This property is deprecated in favor of [`TextSize`](https://rapi.sleaze.dev/classes/TextLabel.md) which is an integer and not an enum and thus offers far more options for sizes.

Determines the font size to be used.

### TextColor

```luau
TextLabel.TextColor: BrickColor
```

- Tags: Deprecated, Hidden, Not replicated, Read capabilities: UI, Load only

**Deprecated:** This item has been superseded by [`TextLabel.TextColor3`](https://rapi.sleaze.dev/classes/TextLabel.md) which should be used in all new work.

Determines the color of text.

### TextWrap

```luau
TextLabel.TextWrap: boolean = false
```

- Tags: Deprecated, Not replicated, Read capabilities: UI, Load only
- Use instead: [`TextLabel.TextWrapped`](https://rapi.sleaze.dev/classes/TextLabel.md)

**Deprecated:** This property is simply an alias for [`TextWrapped`](https://rapi.sleaze.dev/classes/TextLabel.md). Use the past-tense version instead.

Determines whether or not text should wrap at the edges of the [`TextLabel`](https://rapi.sleaze.dev/classes/TextLabel.md) element's space.

## Methods

### SetTextFromInput

```luau
TextLabel:SetTextFromInput(text: string)
```

- Tags: Roblox script security, Capabilities: UI

## Inherited members

- From [GuiObject](https://rapi.sleaze.dev/classes/GuiObject.md): `SelectionImageObject`, `ClipsDescendants`, `Draggable`, `Active`, `AnchorPoint`, `AutomaticSize`, `BackgroundColor3`, `BackgroundTransparency`, `BorderColor3`, `BorderMode`, `BorderSizePixel`, `InputSink`, `Interactable`, `LayoutOrder`, `Position`, `Rotation`, `SelectionRect2D`, `Sink`, `Size`, `SizeConstraint`, `Visible`, `ZIndex`, `BackgroundColor`, `BorderColor`, `Transparency`, `DragBeginConnectionCount`, `DragStoppedConnectionCount`, `MouseEnterConnectionCount`, `MouseLeaveConnectionCount`, `MouseMovedConnectionCount`, `MouseWheelBackwardConnectionCount`, `MouseWheelForwardConnectionCount`, `NextSelectionDown`, `NextSelectionLeft`, `NextSelectionRight`, `NextSelectionUp`, `Selectable`, `SelectionOrder`, `GuiState`, `TweenPositionInternal`, `TweenSizeAndPositionInternal`, `TweenSizeInternal`, `TweenPosition`, `TweenSize`, `TweenSizeAndPosition`, `InputBegan`, `InputChanged`, `InputEnded`, `MouseEnter`, `MouseLeave`, `MouseMoved`, `MouseWheelBackward`, `MouseWheelForward`, `SelectionGained`, `SelectionLost`, `TouchLongPress`, `TouchPan`, `TouchPinch`, `TouchRotate`, `TouchSwipe`, `TouchTap`, `DragBegin`, `DragStopped`
- From [GuiBase2d](https://rapi.sleaze.dev/classes/GuiBase2d.md): `AbsolutePosition`, `AbsoluteRotation`, `AbsoluteSize`, `ActiveQueryNames`, `ReplicatedInsertionOrder`, `ClippedRect`, `IsNotOccluded`, `RawRect2D`, `TotalGroupScale`, `AutoLocalize`, `RootLocalizationTable`, `Localize`, `SelectionBehaviorDown`, `SelectionBehaviorLeft`, `SelectionBehaviorRight`, `SelectionBehaviorUp`, `SelectionGroup`, `SelectionChanged`
- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
