【UGUI】Rich Text rich text introduction and use

​ Rich text refers to adding specific tags to the text, so that it can be customized in terms of style, color, font, etc. when displaying the text. In rich text, each character in the text can have different styles and attributes. In Unity, Rich Text markup language can be used to implement rich text.

        Explanation of rich text in Unity official: Rich Text - Unity Manual

        Rich Text Markup Language is a tag-based language, similar to HTML. Using the Rich Text markup language, you can add various styles to your text, such as color, font, size, bold, italic, underline, and more.

        In Unity, rich text can be displayed using the Text component. To display rich text in a Text component, simply add the text string's Rich Text tag to the string.

        Here are some examples of common Rich Text markup:

        <color=red>Red text</color>
        <size=30>30 point font</size>
        <b>Bold text</b>
        <i>Italic text</i>
        <u>Underlined text</u >

        In addition to the above examples, there are many other Rich Text tags, such as font, font size, text alignment, and so on. When using Rich Text tags, you can customize the tags according to your needs.

​ To use Rich Text in Unity, make sure the "Rich Text" checkbox is enabled (default enabled) in the Text field of the Text component, as indicated by the arrow in the image below. If this option is not enabled, the text will be displayed as plain text without any styling effects applied.

Guess you like

Origin blog.csdn.net/m0_51942776/article/details/130429462