# TextButton

TextButton : `GuiButton`

## Overview

TextButton displays text just like TextLabel, but it adds interactable buttons. In other words, it is a UI element that displays text as well as uses the events of GuiButton like click and tap.

TextButton can be controlled only in **client environment**.

## Properties

### Bold

`boolean`

Specifies whether to render the text displayed in TextButton in Bold.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.Bold = true
```

### LocalizedText

`string`

A read-only property that returns the automatically translated result string based on the current client's locale.

Use this property to check the translated result actually displayed on the button when the original string assigned to the Text property is translated.

Automatic translation is applied only when the AutoLocalize property is true.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

print(TextButton.LocalizedText)
```

### Text

`string`

Specifies the text value to be displayed in TextButton.

Text is visually expressed by a variety of properties including color, transparency, size, font, alignment, and others.

In editor (Properties window), Shift + Enter can be used to input line break; in script, the character can be used to apply linefeed.

In addition, unlike TextLabel, user cannot break line with Shift + Enter in editor (Properties window). If line break is needed, user must use the character to apply linefeed.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.Text = "Hello"
```

### TextColor3

`Color3`

Specifies the color to be applied to text.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.TextColor3 = Color3.new(255, 0, 0)
```

### TextScaled

`boolean`

Determines whether text size is automatically adjusted to fill the entire area of TextButton.

When this feature is used, the TextSize value is ignored and TextWrapped will automatically be enabled.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.TextScaled = true
```

### TextSize

`number`

Controls text size in pixels; a higher value makes text displayed bigger.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.TextSize = 50
```

### TextTransparency

`number`

Specifies the transparency of text.

0 means the text is completely opaque while 1 means the text is totally invisible.

If background needs to be hidden while text is displayed, set BackgroundTransparency to 1.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.TextTransparency = 0.5
```

### TextWrapped

`boolean`

Specifies whether the text in TextButton to automatically break line in order to stay in the text area.

If this property is set true, a long sentence is divided into several lines to fit in TextButton. Line break will be processed based on blank character.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.TextWrapped = true
```

### TextXAlignment

`Enum.TextXAlignment`

Specifies whether text is placed the left, center, or right section of the TextButton area.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.TextXAlignment = Enum.TextXAlignment.Left
```

### TextYAlignment

`Enum.TextYAlignment`

Specifies whether text is placed the top, center, or bottom section of the TextButton area.

#### Code Samples

```lua
local ScreenGui = script.Parent
local TextButton = ScreenGui:WaitForChild("TextButton")

TextButton.TextYAlignment = Enum.TextYAlignment.Top
```

## Methods

## Events

## See also


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/classes/textbutton.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
