# TextButton

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

- Inherits from, nearest first: [GuiButton](https://rapi.sleaze.dev/classes/GuiButton.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/TextButton/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/TextButton

A 2D user interface element that displays interactive text.

## Properties

### Confidential

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

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

### LocalizedText

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

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

Sets whether a [`TextButton`](https://rapi.sleaze.dev/classes/TextButton.md) should be [`GuiBase2d.Localize`](https://rapi.sleaze.dev/classes/GuiBase2d.md) or not.

### ContentText

```luau
TextButton.ContentText: string = "Button"
```

- Tags: Read only, Read capabilities: UI

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

### Font

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

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

Determines the font used to render text.

### FontFace

```luau
TextButton.FontFace: Font
```

- Tags: Read capabilities: UI

Determines the font used to render text.

### LineHeight

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

- Tags: Read capabilities: UI

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

### LocalizationMatchedSourceText

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

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

### LocalizationMatchIdentifier

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

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

### MaxVisibleGraphemes

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

- Tags: Read capabilities: UI

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

### OpenTypeFeatures

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

- Tags: Read capabilities: UI

Applies OpenType font features, such as stylistic sets, to the text rendered by the [`TextButton`](https://rapi.sleaze.dev/classes/TextButton.md).

### OpenTypeFeaturesError

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

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

Read-only property that contains the error message, if any, produced while applying [`OpenTypeFeatures`](https://rapi.sleaze.dev/classes/TextButton.md).

### RichText

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

- Tags: Read capabilities: UI

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

### Text

```luau
TextButton.Text: string = "Button"
```

- Tags: Read capabilities: UI

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

### TextBounds

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

- Tags: Read only, Read capabilities: UI

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

### TextColor3

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

- Tags: Read capabilities: UI

Determines the color of rendered text.

### TextDirection

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

- Tags: Read capabilities: UI

Direction in which the text is rendered.

### TextFits

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

- Tags: Read only, Read capabilities: UI

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

### TextScaled

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

- Tags: Read capabilities: UI

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

### TextSize

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

- Tags: Read capabilities: UI

Determines the line height of text in offsets.

### TextStrokeColor3

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

- Tags: Read capabilities: UI

Determines the color of the text stroke (outline).

### TextStrokeTransparency

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

- Tags: Read capabilities: UI

Determines the transparency of the text stroke (outline).

### TextTransparency

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

- Tags: Read capabilities: UI

Determines the transparency of rendered text.

### TextTruncate

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

- Tags: Read capabilities: UI

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

### TextWrapped

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

- Tags: Read capabilities: UI

Determines if text wraps to multiple lines within the [`TextButton`](https://rapi.sleaze.dev/classes/TextButton.md) element's space, truncating excess text.

### TextXAlignment

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

- Tags: Read capabilities: UI

Determines the horizontal alignment of rendered text.

### TextYAlignment

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

- Tags: Read capabilities: UI

Determines the vertical alignment of rendered text.

### FontSize

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

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

**Deprecated:** This property is deprecated in favor of [`TextSize`](https://rapi.sleaze.dev/classes/TextButton.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
TextButton.TextColor: BrickColor
```

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

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

Determines the color of text.

### TextWrap

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

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

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

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

## Methods

### SetTextFromInput

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

- Tags: Roblox script security, Capabilities: UI

## Inherited members

- From [GuiButton](https://rapi.sleaze.dev/classes/GuiButton.md): `AutoButtonColor`, `Modal`, `Style`, `MouseButton1ClickConnectionCount`, `MouseButton1DownConnectionCount`, `MouseButton1UpConnectionCount`, `MouseButton2ClickConnectionCount`, `MouseButton2DownConnectionCount`, `MouseButton2UpConnectionCount`, `HoverHapticEffect`, `PressHapticEffect`, `Selected`, `Activated`, `MouseButton1Click`, `MouseButton1Down`, `MouseButton1Up`, `MouseButton2Click`, `MouseButton2Down`, `MouseButton2Up`, `SecondaryActivated`
- 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`
