Class RichTextParser
Creates UIToolkit elements from a rich text.
Inherited Members
Namespace: Unity.Tutorials.Core.Editor
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. |