UI rich text utilizes simple markup tags to style sections of a string in bold, italics, underline, fill color, stroke variations, and more. Puoi applicare styling tags to TextLabel , TextButton , e TextBox oggetti.
Abilita testo ricco
Devi abilitare il testo ricco su base per oggetto attraverso la sua proprietà RichText nella finestra Proprietà, o impostando la proprietà su true in un Class.LocalScript .

local title = Instance.new("TextLabel")title.RichText = truetitle.Text = "Use a <b>bold title</b>"
Tag supportati
I tag Rich text sono simili ai tag XML/HTML e devi includere sia un tag di apertura che di chiusura attorno al testo formattato.
<b>Formatted text</b>
Puoi anche annidare i tag l'uno dentro l'altro a patto che li chiudi nell'ordine in cui sono stati aperti.
<b><i><u>Formatted text</u></i></b>
Colore
<font color=""> </font>
I want the <font color="#FF7800">orange</font> candy.``I want the <font color="rgb(255,125,0)">orange</font> candy.

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

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

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

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

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

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

Bold
<b> </b>
Text in <b>bold</b>.

Italico
<i> </i>
Text <i>italicized</i>.

Sottolinea
<u> </u>
Text <u>underlined</u>.

Colpire attraverso
Text with strikethrough

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

Casuscolo in alto
<uppercase> </uppercase>``<uc> </uc>
<uppercase>Uppercase</uppercase> makes words read loudly!``<uc>Uppercase</uc> makes words read loudly!

Piccole cialde
<smallcaps> </smallcaps>``<sc> </sc>
My name is <smallcaps>Diva Dragonslayer</smallcaps>.``My name is <sc>Diva Dragonslayer</sc>.

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

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

Forme di fuga
Se vuoi rendere alcuni personaggi come < o > e esentarli dalla considerazione come parte dei tag di testo ricchi, puoi scriverli nella loro forma di fuga .
Personagem | 逃脱 | Exemplo | Resultado |
---|---|---|---|
<) | < | 10 < 100 ]] | 10 <100 |
> | ><1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1<1< | 100 > 10 | 100 > 10 |
"título de exemplo" | " | Meet "Diva Dragonslayer" | Conheça "Diva Dragonslayer" |
“ | ' | Diva's pet is a falcon! | Animal de estimação da Diva é um falcão! |
和 | & | Render another escape form <b>&lt;</b> by escaping an ampersand | Render outro formulário de fuga < ao escapar de um ampersand |