-
Notifications
You must be signed in to change notification settings - Fork 5
Icons
Falko edited this page Nov 3, 2023
·
2 revisions
If you want to use icons within SEE, you can use any of the (free) icons from FontAwesome v6.
To display an icon in SEE, add a TextMeshPro component to the object where you want to display the icon. Use the UI variant of the TextMeshPro component if you want to display it in screen space (i.e., on the 2D canvas). In the new component, set the font to the "Font Awesome 6 Free" font.
Go to the FontAwesome v6 site and choose any icon you like that does not have the "Pro" badge next to it. Once you have found an icon, click on it.
Now, what you need to do depends on whether you want to set the icon statically (in the editor) or dynamically (in the code):
-
Setting the icon via the editor: In the upper right corner of the page, click on the
Glyph
to copy it to your clipboard. Then, in the Unity editor, simply paste it into the TextMeshPro component's "Text Input" field. -
Setting the icon via code: In the upper right corner, look for the
Unicode
field to find the hexadecimal code (you can also click on it to copy it to your clipboard). In C#, you can represent the icon as a character by doingchar icon = '\uF05A';
(for hexadecimal codef05a
). You can use the same syntax in astring
. Setting the icon in the TextMeshPro might look like this:
gameObject.MustGetComponent<TextMeshProUGUI>().text = "\uF05A";