リッチテキストマークアップ

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。

UI リッチテキスト は、単純なマークアップタグを使用して、文字列のセクションをボールド、イタリック、アンダーライン、満タンの色、ストロークの変化などで装飾します。スタイリングタグを TextLabelTextButton、および TextBox オブジェクトに適用できます。

リッチテキストを有効にする

リッチテキストをオブジェクトごとに有効にするには、 リッチテキスト プロパティを プロパティ ウィンドウで設定したり、true に設定したり、または LocalScript で設定したりする必要があります。


local title = Instance.new("TextLabel")
title.RichText = true
title.Text = "Use a <b>bold title</b>"

サポートされるタグ

リッチテキストタグは、XML/HTML タグと似ており、形式化されたテキストの周りに開始と閉じタグを両方含める必要があります。

<b>Formatted text</b>

開いた順序の逆で閉じる限り、タグを互いにネストしてもよいです。

<b><i><u>Formatted text</u></i></b>

フォントの色

<font color=""> </font>

I want the <font color="#FF7800">orange</font> candy. I want the <font color="rgb(255,125,0)">orange</font> candy.

フォントサイズ

<font size=""> </font>

<font size="40">This is big.</font> <font size="20">This is small.</font>

フォントフェイス

<font face=""> </font>

<font face="Michroma">This is Michroma face.</font>

フォント家族

<font family=""> </font>

<font family="rbxasset://fonts/families/Michroma.json">This is Michroma face.</font>

フォントの重量

<font weight=""> </font>

This is normal. <font weight="heavy">This is heavy.</font> This is normal. <font weight="900">This is heavy.</font>

フォントの透明性

<font transparency=""> </font>

Text at <font transparency="0.5">50% transparency</font>.

ストローク

<stroke> </stroke>

You won <stroke color="#00A2FF" joins="miter" thickness="2" transparency="0.25">25 gems</stroke>.

ボールド

<b> </b>

Text in <b>bold</b>.

イタリック

<i> </i>

Text <i>italicized</i>.

下線

<u> </u>

Text <u>underlined</u>.

取り消し線

<s> </s>

Text with <s>strikethrough</s> applied.

行ブレーク

<br/>

New line occurs after this sentence.<br/>Next sentence...

大文字

<uppercase> </uppercase> <uc> </uc>

<uppercase>Uppercase</uppercase> makes words read loudly! <uc>Uppercase</uc> makes words read loudly!

小さなキャップ

<smallcaps> </smallcaps> <sc> </sc>

My name is <smallcaps>Diva Dragonslayer</smallcaps>. My name is <sc>Diva Dragonslayer</sc>.

マーク

<mark> </mark>

Text <mark color="#009966" transparency="0">highlighted</mark>.

コメント

<!-- -->

After this is a comment...<!--This does not appear in the final text--> and now more text...

フォームを脱出する

特定のキャラクターをレンダリングしたい、例えば < または > として、リッチテキストタグの一部として考慮から除外したい場合は、 脱出形式 に書くことができます。

キャラクタ脱出結果
<&lt;10 &lt; 10010 < 100
>&gt;100 &gt; 10100 > 10
"&quot;Meet &quot;Diva Dragonslayer&quot;「ディヴァドラゴンスレイヤー」に会う
'&apos;Diva&apos;s pet is a falcon!ディヴァのペットはファルコンです!
&&amp;Render another escape form <b>&amp;lt;</b> by escaping an ampersandアンパーセンドを脱出して別の脱出形式をレンダリングする < によって