docs.unity.cn
    Show / Hide Table of Contents

    Class RichTextParser

    Creates UIToolkit elements from a rich text.

    Inheritance
    Object
    RichTextParser
    Namespace: Unity.Tutorials.Core.Editor
    Syntax
    public static class RichTextParser : object

    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.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Thursday, July 8, 2021