UMarkup
UMarkup is a simplified extension for Unity RichText Markup,It can enhance the text style of Log / UGUI Text / GUI Label, also for TextMeshPro.
-
- 1.1. Extension Style
- 1.2. Method Style
-
- 2.1. Font Sytle
- 2.2. Color Sytle
- 2.3. Other
-
- 3.1. Supported Tags
- 3.2. Supported Size Formart
How to use
1.Extension Style
1.1.var str1 = "[Markup Test 1]"
// <size=15><b><color=green>Complex Style</color></b></size>
+ " Complex Style".ToMarkup(UMarkup.Green, UMarkup.Bold, UMarkup.Size(15))
// <color=#ffffff>White</color>
+ " White".ToMarkup(Color.white)
// <i>Italics</i>
+ " Italics".ToMarkup(UMarkup.Italic)
// <b>Bold</b>
+ " Bold".ToMarkup(UMarkup.Bold);
Debug.Log(str1);
Method Style
1.2.var str2 = "[Markup Test 2]"
// <size=15><b><color=green>Complex Style</color></b></size>
+ UMarkup.Create(" Complex Style", UMarkup.Yellow, UMarkup.Italic, UMarkup.Size(12))
// <color=#ffffff>White</color>
+ UMarkup.Create(" White", UMarkup.Color(Color.white))
// <i>Italics</i>
+ UMarkup.Create(" Italics", UMarkup.Italic)
// <b>Bold</b>
+ UMarkup.Create(" Bold", UMarkup.Bold);
Debug.Log(str2);
Supported Tags
2.Font Sytle
2.1.- Size
- Bold
- Italic
Color Sytle
2.2.- Red
- Green
- Blue
- White
- Blank
- Yellow
- Cyan
- Magenta
- Gray
- Clear
- Color
Other
2.3.- Material
- Quad
Extension for TextMeshPro
3.You can also use UMarkup to build strings for TextMeshPro. The supported tag styles are as follows:
Supported Tags
3.1.- AlignLeft
- AlignCenter
- AlignRight
- Alpha
- CharacterSpace
- Font
- Indentation
- LineHeight
- LineIndentation
- Link
- Lowercase
- Uppercase
- AllCaps
- SmallCaps
- Margin
- Mark
- MonoSpace
- Noparse
- NoBreakingSpaces
- PageBreak
- HorizontalPosition
- Size
- HorizontalSpace
- Sprite
- Underline
- Strikethrough
- Style
- Superscript
- Subscript
- VerticalOffset
- Width
Supported Size Formart
3.2.- Pixels
- FontUnits
- Percentages