GetTextBoundsParams
사용되지 않는 항목 표시
*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.
이 인스턴스를 TextService:GetTextBoundsAsync()로 전달하여 텍스트 크기를 측정합니다.
코드 샘플
This example shows how you can use TextService:GetTextBoundsAsync().
It measures the size of some text in a specific font, then prints the result.
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)
요약
속성
측정되는 텍스트의 Font입니다.
측정되는 텍스트의 크기.
측정되는 텍스트.
줄 바꾸기를 위한 컨테이너 너비.
속성
Font
측정되는 텍스트의 Font 속성. 텍스트 개체의 TextLabel.FontFace 속성과 일치합니다.
Enum.Font 와 혼동되지 않습니다. 이것은 Font.new() 를 사용하여 만들 수 있는 개체입니다.