Extension methods and helper utilities for using Material Icons with TextMeshPro components.
More...
|
| static void | SetMaterialIcon (this TextMeshProUGUI text, string iconName) |
| | Sets a Material Icon on a TextMeshProUGUI component Example: myText.SetMaterialIcon("home");.
|
| |
| static void | SetMaterialIcon (this TMP_Text text, string iconName) |
| | Sets a Material Icon on a TMP_Text component.
|
| |
| static void | SetMaterialIconWithText (this TextMeshProUGUI text, string iconName, string labelText, string separator=" ") |
| | Sets a Material Icon with text on a TextMeshProUGUI component Example: myText.SetMaterialIconWithText("save", "Save Document");.
|
| |
| static void | SetTextWithMaterialIcon (this TextMeshProUGUI text, string labelText, string iconName, string separator=" ") |
| | Sets text with a Material Icon suffix on a TextMeshProUGUI component Example: myText.SetTextWithMaterialIcon("Save Document", "save");.
|
| |
| static void | SetMaterialIconWithText (this TMP_Text text, string iconName, string labelText, string separator=" ") |
| | Sets a Material Icon with text on a TMP_Text component.
|
| |
| static void | UpdateIcon (this TextMeshProUGUI text, string iconName) |
| | Updates only the icon text without changing the font Useful when the font is already set.
|
| |
| static void | UpdateIcon (this TMP_Text text, string iconName) |
| | Updates only the icon text without changing the font.
|
| |
| static TMP_FontAsset | GetTMPFont () |
| | Gets or loads the TMP_FontAsset for Material Icons with caching The font asset should be located at Resources/Icons/MaterialIcons/Fonts/MaterialIcons-RegularSDF.
|
| |
| static void | ClearFontCache () |
| | Clears the font cache (useful if fonts are reloaded)
|
| |
| static GameObject | CreateIconObject (string iconName, Transform parent=null) |
| | Creates a GameObject with TextMeshProUGUI component displaying a Material Icon.
|
| |
| static void | AddIconToButton (Button button, string iconName) |
| | Adds a Material Icon to an existing button.
|
| |
Extension methods and helper utilities for using Material Icons with TextMeshPro components.
Provides convenient methods to set icons on TMP_Text and TextMeshProUGUI components, combine icons with text, and manage Material Icons fonts at runtime.