UI reicher Text verwendet einfache Markierungs标签, um Abschnitte einer Zeichenkette in Fett, Italisch, Unterstrich, Füllfarbe, Strichvariationen und mehr zu formatieren.Du kannst Stil-Tags auf TextLabel , TextButton und TextBox Objekte anwenden.
Reichen Text aktivieren
Du musst reichen Text auf der Grundlage eines jeden Objekts durch seine Reichstext -Eigenschaft im Eigenschaften-Fenster aktivieren oder die Eigenschaft auf true in einem LocalScript festlegen.

local title = Instance.new("TextLabel")title.RichText = truetitle.Text = "Use a <b>bold title</b>"
Unterstützte Tags
Reiche Texttags sind ähnlich wie XML/HTML-Tags, und du musst sowohl ein Öffnungs- als auch ein Schließ标 um den formatierten Text herum einfügen.
<b>Formatted text</b>
Du kannst auch Tags innerhalb einander verschachteln, solange du sie in der umgekehrten Reihenfolge schließt, in der du sie geöffnet hast.
<b><i><u>Formatted text</u></i></b>
Schriftfarbe
<font color=""> </font>
I want the <font color="#FF7800">orange</font> candy.``I want the <font color="rgb(255,125,0)">orange</font> candy.

Schriftgröße
<font size=""> </font>
<font size="40">This is big.</font> <font size="20">This is small.</font>

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

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

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

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

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

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

Italisch
<i> </i>
Text <i>italicized</i>.

Unterstrich
<u> </u>
Text <u>underlined</u>.

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

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

Großbuchstabe
<uppercase> </uppercase>``<uc> </uc>
<uppercase>Uppercase</uppercase> makes words read loudly!``<uc>Uppercase</uc> makes words read loudly!

Kleine Caps
<smallcaps> </smallcaps>``<sc> </sc>
My name is <smallcaps>Diva Dragonslayer</smallcaps>.``My name is <sc>Diva Dragonslayer</sc>.

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

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

Formulare entkommen
Wenn du bestimmte Zeichen wie < oder > rendern und sie von der Betrachtung als Teil von reichhaltigen Texttags ausnehmen möchtest, kannst du sie in ihrer Fluchtbildform schreiben.
Zeichen | Entkommen | Beispiel | Ergebnis |
---|---|---|---|
< | < | 10 < 100 | 10 < 100 |
> | > | 100 > 10 | 100 > 10 |
" | " | Meet "Diva Dragonslayer" | Treffe "Diva Dragonslayer" |
' | ' | Diva's pet is a falcon! | Divas Haustier ist ein Falken! |
& | & | Render another escape form <b>&lt;</b> by escaping an ampersand | Renderiere eine andere Fluchtbildform < durch die Flucht eines Ampersands |