> 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/korean/development/api-reference/classes/textlabel.md).

# TextLabel

TextLabel : `GuiLabel`

## Overview

TextLabel은 Frame과 달리 사각형 영역에 텍스트를 표시할 수 있는 UI 요소입니다.

텍스트의 색상이나 투명도 조절은 TextColor3 및 TextTransparency 속성으로 제어할 수 있으며, 배경을 숨기고 이미지만 표시하고 싶다면 BackgroundTransparency를 1로 설정하면 됩니다.

TextLabel은 **클라이언트 환경**에서만 제어할 수 있습니다.

## Properties

### ContentText

`string`

Text에서 서식 태그를 제외한 텍스트를 나타내는 읽기 전용 속성입니다.

RichText가 true이면 Text에서 서식 태그를 제거한 문자열이 되고, false이면 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`

TextLabel에 표시되는 텍스트에 적용할 폰트를 지정합니다.

폰트 패밀리와 굵기, 기울임 여부를 함께 지정하며, 기본값은 Regular 굵기의 기본 폰트입니다.

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

여러 줄 텍스트의 줄 간격 배율을 지정합니다.

기본값은 1이며, 값이 클수록 줄 사이의 간격이 넓어집니다.

#### Code Samples

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

TextLabel.LineHeight = 1.5
```

### LocalizedText

`string`

현재 클라이언트의 로케일을 기준으로 자동 번역된 결과 문자열을 반환하는 읽기 전용 속성입니다.

Text 속성에 등록된 원본 문자열이 번역되었을 때, 실제 버튼에 표시되는 번역 결과를 확인할 때 사용합니다.

자동 번역은 AutoLocalize 속성이 true인 경우에만 적용됩니다.

#### Code Samples

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

print(TextLabel.LocalizedText)
```

### MaxVisibleGraphemes

`number`

텍스트를 앞에서부터 몇 글자까지 표시할지 지정합니다.

기본값 -1은 전체 텍스트를 표시합니다. 값을 0부터 차례로 늘리면 텍스트가 한 글자씩 나타나는 연출을 만들 수 있습니다.

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

Text에 포함된 서식 태그를 해석해 텍스트 일부에 굵기나 색상 등의 서식을 적용할지 지정합니다.

false이면 태그가 문자 그대로 표시됩니다. 태그를 제외한 실제 표시 텍스트는 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`

TextLabel에 표시할 텍스트 값을 지정합니다.

텍스트는 색상, 투명도, 크기, 폰트, 정렬 등의 다양한 속성에 의해 시각적으로 표현됩니다.

또한 편집기(Properties 창)에서는 Shift + Enter를 사용해 줄바꿈을 입력할 수 있으며, 스크립트에서는 문자를 사용해 개행을 적용할 수 있습니다.

#### Code Samples

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

TextLabel.Text = "Hello"
```

### TextBounds

`Vector2`

현재 설정으로 텍스트 전체를 표시하는 데 필요한 크기를 픽셀 단위로 나타내는 읽기 전용 속성입니다.

TextSize, LineHeight, TextWrapped 등 텍스트 배치에 영향을 주는 속성이 바뀌면 함께 갱신됩니다.

#### Code Samples

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

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

### TextColor3

`Color3`

텍스트에 적용되는 색상을 지정합니다.

#### Code Samples

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

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

### TextDirection

`Enum.TextDirection`

텍스트를 읽는 방향을 지정합니다.

* `Auto`: 방향을 자동으로 결정합니다.
* `LeftToRight`: 왼쪽에서 오른쪽으로 표시합니다.
* `RightToLeft`: 오른쪽에서 왼쪽으로 표시합니다.

#### Code Samples

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

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

### TextFits

`boolean`

텍스트가 UI 요소의 영역 안에 모두 들어가는지를 나타내는 읽기 전용 속성입니다.

텍스트가 영역을 넘으면 false입니다. TextTruncate로 넘치는 부분을 줄이거나 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`

텍스트가 TextLabel의 전체 영역을 채우도록 자동으로 크기를 조정할지 여부를 결정합니다.

이 기능을 사용하면 TextSize 값은 무시되며, TextWrapped는 자동으로 활성화됩니다.

#### Code Samples

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

TextLabel.TextScaled = true
```

### TextSize

`number`

텍스트의 크기를 Pixel 단위로 제어하며, 값이 클수록 텍스트가 더 크게 표시됩니다.

#### Code Samples

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

TextLabel.TextSize = 50
```

### TextStrokeColor3

`Color3`

텍스트 외곽선의 색상을 지정합니다.

외곽선은 TextStrokeTransparency가 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`

텍스트 외곽선의 투명도를 지정합니다.

0은 완전한 불투명 상태를 의미하고, 1은 외곽선이 보이지 않는 상태를 의미합니다. 기본값은 1입니다.

#### Code Samples

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

TextLabel.TextStrokeTransparency = 0.5
```

### TextTransparency

`number`

텍스트의 투명도를 지정합니다.

0은 완전한 불투명 상태를 의미하고, 1은 전혀 보이지 않는 상태를 의미합니다.

배경을 숨기고 텍스트만 표시하고 싶다면 BackgroundTransparency를 1로 설정하면 됩니다.

#### Code Samples

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

TextLabel.TextTransparency = 0.5
```

### TextTruncate

`Enum.TextTruncate`

텍스트가 UI 요소의 영역을 넘을 때 넘치는 부분을 줄이는 방식을 지정합니다.

* `None`: 텍스트를 줄이지 않습니다.
* `AtEnd`: 영역을 넘는 부분을 단어 단위로 잘라내고 끝에 말줄임표(...)를 표시합니다.
* `SplitWord`: 단어 중간에서도 잘라내고 끝에 말줄임표(...)를 표시합니다.

#### Code Samples

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

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

### TextWrapped

`boolean`

TextLabel의 텍스트가 요소의 영역을 넘어가지 않도록 자동으로 줄바꿈할지 여부를 지정합니다.

이 속성이 true로 설정되면 긴 문장은 TextLabel의 폭에 맞추어 여러 줄로 나누어 표시되며, 줄 분리는 공백 문자를 기준으로 처리됩니다.

#### Code Samples

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

TextLabel.TextWrapped = true
```

### TextXAlignment

`Enum.TextXAlignment`

텍스트가 TextLabel 영역에서 왼쪽, 가운데, 오른쪽 중 어디에 배치될지를 지정합니다.

#### Code Samples

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

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

### TextYAlignment

`Enum.TextYAlignment`

텍스트가 TextLabel 영역에서 위쪽, 가운데, 아래쪽 중 어디에 배치될지를 지정합니다.

#### 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/vfXVtIghd2oxs1YxnIDw" %}
[Font](/korean/development/api-reference/datatype/font.md)
{% endcontent-ref %}

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

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