# TextLabel

TextLabel : `GuiObject`

## 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

### Bold

`bool`

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

#### Code Samples

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

TextLabel.Bold = true
```

### 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 \n character can be used to apply linefeed.

#### Code Samples

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

TextLabel.Text = "Hello"
```

### 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)
```

### TextScaled

`bool`

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
```

### 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
```

### TextWrapped

`bool`

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
