GetTextBoundsParams

사용되지 않는 항목 표시
복제되지 않음

Pass this instance to TextService:GetTextBoundsAsync() to measure the size of text.

코드 샘플

TextService: Measuring text size

local TextService = game:GetService("TextService")
local params = Instance.new("GetTextBoundsParams")
params.Text = "hello world!"
params.Font = Font.new("rbxasset://fonts/families/GrenzeGotisch.json", Enum.FontWeight.Thin)
params.Size = 20
params.Width = 200
local size = TextService:GetTextBoundsAsync(params)
print("The size of the text is:", size)

요약

속성

  • 병렬 읽기

    The Font of the text being measured.

  • 병렬 읽기

    The size of the text being measured.

  • 병렬 읽기

    The text being measured.

  • 병렬 읽기

    The width of the container for line breaking.

속성

병렬 읽기

The Font of the text being measured. Corresponds to the TextLabel.FontFace property on text objects.

Not to be confused with Enum.Font. This is an object that you can create using Font.new().

Size

병렬 읽기

The size of the text that is being measured. Corresponds to the TextLabel.TextSize property.

Text

병렬 읽기

The text being measured.

Width

병렬 읽기

The width of the container for line breaking. By default, the value is 0, which means no line breaking will be performed. You can set it to the width of the container that you'll be putting the text into.

메서드

이벤트