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() を使用して作成できるオブジェクトです。

RichText

並列読み取り

Size

並列読み取り

測定されているテキストのサイズ。TextLabel.TextSize プロパティに対応します。

Text

並列読み取り

測定されるテキスト。

Width

並列読み取り

行を分割するためのコンテナの幅。デフォルトでは、値は 0 で、行の分割は行われません。テキストを入れるコンテナの幅に設定できます。

方法

イベント