Text Elements
テキストエレメント (Text Element) は、font assetを使用してテキスト文字列を表示するために使用されます。
テキスト (Text)
テキストエレメントには、表示されるテキストを入力する文字列フィールドが含まれています。文字列フィールドに改行文字を入力するには、Shift + Enter
を使います。
ヒント
文字列内の各文字に対して1つのクワッドを使用して、テキスト要素が画面に表示されます。テキストプロパティを変更すると、要素のメッシュが再生成されます。これはパフォーマンスに影響しますが、フレームごとに合理的な数の要素にテキストコンテンツを変更することには問題はありません。
Text Markup
Text elements support a simple markup syntax that allows you to apply different colors to specific parts of the text. Consider this example:
[color="#ff0000"]Red[/color], [color="#00ff00"]green[/color] and [color="#0000ff"]blue[/color].
Assuming the base color of the text element is white, this will render as follows:
ヒント
You must proactively enable support for the markup syntax on a text element. You can do this via the API:
entity.element.enableMarkup = true;