エンジンクラス
GetTextBoundsParams
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
概要
コードサンプル
テキストサイズの測定
local TextService = game:GetService("TextService")
-- パラメータを宣言
local params = Instance.new("GetTextBoundsParams")
params.Text = "こんにちは世界!"
params.Font = Font.new("rbxasset://fonts/families/GrenzeGotisch.json", Enum.FontWeight.Thin)
params.Size = 20
params.Width = 200
local success, bounds = pcall(function()
return TextService:GetTextBoundsAsync(params)
end)
if success then
print(bounds)
endAPIリファレンス
プロパティ