お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseテキストフォーマットマークアップでHTML-styleタグが使用可能になる。
サポートするタグは:
<color="htmlcolor">colored text</color>、 "htmlcolor"はhtmlカラー文字列で、"#ff0000" や "red" のようなものです。
<b>bold text</b>
<i>italic text</i>
<size=20>sized text</size>
<material=1>render using custom material index</material>
<quad material=1 size=20 x=0.1 y=0.1 width=0.5 height=0.5>、 与えられたマテリアルとUVを使用してquad一つをレンダーします。テキスト内に埋め込まれた画像に使用されます。
これらはフォントをダイナミックフォントレンダリングに設定したときのみサポートされます。ただし'color'、'material' そして 'quad'タグは除きます。
Unityのリッチテキストは全htmlを実装していません。他のタグはサポート対象外です。
GetComponent(TextMesh).richText = true;
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Example() { GetComponent<TextMesh>().richText = true; } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Example() as void: GetComponent[of TextMesh]().richText = true