> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/classes/textlabel.md).

# TextLabel

TextLabel : `GuiLabel`

## Overview

Unlike Frame, TextLabel is a UI element that can be used to display text in a square.

The color and transparency of image can be adjusted with the TextColor3 and TextTransparency properties. If background needs to be hidden while image is displayed, set BackgroundTransparency to 1.

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

## Properties

### ContentText

`string`

A read-only property that indicates the text of Text without formatting tags.

If RichText is true, it is the string with formatting tags removed from Text, and if false, it is the same as Text.

#### Code Samples

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

TextLabel.RichText = true
TextLabel.Text = "<b>Bold</b> text"
print(TextLabel.ContentText)
```

### FontFace

`Font`

Specifies the font applied to the text displayed in the TextLabel.

The font family, the thickness, and the italic style are specified together as a single value. The default value is the default font with the Regular thickness.

#### Code Samples

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

TextLabel.FontFace = Font.fromName("Fredoka", Enum.FontWeight.Bold, Enum.FontStyle.Normal)
```

### LineHeight

`number`

Specifies the line spacing scale of multi-line text.

The default is 1, and the larger the value, the wider the spacing between lines.

#### Code Samples

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

TextLabel.LineHeight = 1.5
```

### 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 TextLabel = ScreenGui:WaitForChild("TextLabel")

print(TextLabel.LocalizedText)
```

### MaxVisibleGraphemes

`number`

Specifies how many characters of the text to display from the beginning.

The default, -1, displays the entire text. By increasing the value one by one from 0, you can create an effect where the text appears one character at a time.

#### Code Samples

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

TextLabel.Text = "Welcome to OVERDARE"
for count = 0, #TextLabel.Text do
    TextLabel.MaxVisibleGraphemes = count
    task.wait(0.05)
end
TextLabel.MaxVisibleGraphemes = -1
```

### RichText

`boolean`

Specifies whether to interpret formatting tags included in Text and apply formatting such as boldness or color to parts of the text.

If false, the tags are displayed as literal characters. The actual displayed text excluding the tags can be checked with ContentText.

#### Code Samples

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

TextLabel.RichText = true
TextLabel.Text = "<b>Bold</b> and <font color=\"#FF0000\">red</font>"
```

### Text

`string`

Specifies the text value to be displayed in TextLabel.

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.

#### Code Samples

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

TextLabel.Text = "Hello"
```

### TextBounds

`Vector2`

A read-only property that indicates, in pixels, the size required to display the entire text with the current settings.

It is updated when properties that affect text layout, such as TextSize, LineHeight, and TextWrapped, change.

#### Code Samples

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

print("TextBounds : ", TextLabel.TextBounds)
```

### TextColor3

`Color3`

Specifies the color to be applied to text.

#### Code Samples

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

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

### TextDirection

`Enum.TextDirection`

Specifies the reading direction of the text.

* `Auto`: Determines the direction automatically.
* `LeftToRight`: Displays from left to right.
* `RightToLeft`: Displays from right to left.

#### Code Samples

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

TextLabel.TextDirection = Enum.TextDirection.LeftToRight
```

### TextFits

`boolean`

A read-only property that indicates whether the text fits entirely within the area of the UI element.

It is false if the text exceeds the area. It can be used to decide whether to shorten the overflowing part with TextTruncate or to enlarge the area with AutomaticSize.

#### Code Samples

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

if not TextLabel.TextFits then
    TextLabel.TextTruncate = Enum.TextTruncate.AtEnd
end
```

### TextScaled

`boolean`

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

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

#### Code Samples

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

TextLabel.TextScaled = true
```

### TextSize

`number`

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

#### Code Samples

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

TextLabel.TextSize = 50
```

### TextStrokeColor3

`Color3`

Specifies the color of the text stroke.

The stroke is displayed when TextStrokeTransparency is less than 1.

#### Code Samples

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

TextLabel.TextStrokeColor3 = Color3.fromRGB(255, 0, 0)
TextLabel.TextStrokeTransparency = 0
```

### TextStrokeTransparency

`number`

Specifies the transparency of the text stroke.

0 means fully opaque, and 1 means the stroke is not visible. The default is 1.

#### Code Samples

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

TextLabel.TextStrokeTransparency = 0.5
```

### 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 TextLabel = ScreenGui:WaitForChild("TextLabel")

TextLabel.TextTransparency = 0.5
```

### TextTruncate

`Enum.TextTruncate`

Specifies how to shorten the overflowing part when the text exceeds the area of the UI element.

* `None`: Does not shorten the text.
* `AtEnd`: Cuts off the part that exceeds the area by word and displays an ellipsis (...) at the end.
* `SplitWord`: Cuts off even in the middle of a word and displays an ellipsis (...) at the end.

#### Code Samples

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

TextLabel.TextTruncate = Enum.TextTruncate.AtEnd
```

### TextWrapped

`boolean`

Specifies whether the text in TextLabel 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 TextLabel. Line break will be processed based on blank character.

#### Code Samples

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

TextLabel.TextWrapped = true
```

### TextXAlignment

`Enum.TextXAlignment`

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

#### Code Samples

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

TextLabel.TextXAlignment = Enum.TextXAlignment.Left
```

### TextYAlignment

`Enum.TextYAlignment`

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

#### Code Samples

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

TextLabel.TextYAlignment = Enum.TextYAlignment.Top
```

## Methods

## Events

## See also

{% content-ref url="/pages/MseZiBAVju4q6L9qaBVQ" %}
[Font](/development/api-reference/datatype/font.md)
{% endcontent-ref %}

{% content-ref url="/pages/G4OKpyXzJeYFB71XwbDo" %}
[FontStyle](/development/api-reference/enums/fontstyle.md)
{% endcontent-ref %}

{% content-ref url="/pages/CgXuY71GWU7YzsLvFAmO" %}
[FontWeight](/development/api-reference/enums/fontweight.md)
{% endcontent-ref %}
