I am creating a card game where the card text can contain icons (similar to the mana and tap symbols on Magic: The Gathering cards) and I have no idea as to how to get the image into the text. I plan on using a TextMesh
object to display the card text, so if there is a way to add the icons to a TextMesh
that would be preferable, however I am open to suggestions.
After some more thinking and research, I found the quad
tag in the rich text docs here that allows for exactly this functionality.
On the GameObject, add;
MeshRenderer and TextMesh script.
Create a new material for your icon.
Make sure it works elsewhere. UI material is a bit different than other material
On the MeshRenderer component;
Add new material as a new material in the list.
Now you should have two materials on the MeshRenderer;
0 - Font Material
1 - Your Icon Material
Type this into the “Text” text field on the TextMesh component; (access the second material, id 1)