docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RichTextParser

    Creates UIToolkit elements from a rich text.

    Inheritance
    object
    RichTextParser
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Tutorials.Core.Editor
    Assembly: Unity.Tutorials.Core.Editor.dll
    Syntax
    public static class RichTextParser

    Methods

    RichTextToVisualElements(string, VisualElement)

    Transforms HTML tags to word element labels with different styles to enable rich text.

    Declaration
    public static List<VisualElement> RichTextToVisualElements(string htmlText, VisualElement targetContainer)
    Parameters
    Type Name Description
    string htmlText
    VisualElement targetContainer

    The following need to set for the container's style: flex-direction: row; flex-wrap: wrap;

    Returns
    Type Description
    List<VisualElement>

    List of VisualElements made from the parsed text.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)