# Inline sprites in Unity's text?

How can I use different materials when using the tag for Unity's rich text syntax?

I want to be able to have sprites that are inline with my text without having to create custom fonts.

Here's what I have so far: Here's the syntax that I'm using for the text in my image:

Planetary <quad material=1 size=20 x=0.1 y=0.1 width=0.1 height=0.1 /> Intergalactic

I'm guessing "material=1" refers to the material index of the Text object. How can I set it to use a different material altogether?

Is there a plugin or other resource that makes embedding icons in text easier?

• Using a quad with Unity's rich text is the only way to go. The material attribute is the material at the "position in the renderer’s material array". I would preprocess or concat in the proper material index by looking through Renderer.materials to find the material you are after.
– MLM
May 22 '15 at 5:57
• I'll give that a shot and get back with some results, thanks MLM! May 22 '15 at 15:48
• This question is cross-posted on Unity Answers. It seems that while rich text is supported, quads are not according to Tim C and Phil from Unity, see: forum.unity3d.com/threads/…
– MLM
May 22 '15 at 20:27
• I've made an implementation that does this in UI Text (as opposed to the quad method with TextMesh) by dynamically spawning & positioning child images. The details get a little complicated, but if it's useful to anyone I can write it up as an answer. Jan 19 '16 at 19:21
• @DMGregor, I'd love to have you write up an answer or link to your code for your Sprited Image script. Apr 28 '16 at 21:43