How to set a sprite inline with TextMeshPro?

Hello! I’m trying to have a sprite as a part of my text using Rich Text format but to no success. I’ve seen a few questions but with no concrete answers or even answers but I haven’t been able to achieve this.

I’ve already added the sprite i want inside “Assets > TextMeshPro > Resources > Sprite Assets”

But the sprite character table is empty. Shouldnt the sprite be visible here or it doesnt matter? I’ve tried adding <sprite="SpriteAssets" name="SpriteAtlas"> even like the other way around because I’m not actually sure which goes where. But the sprite isnt visible just all that as text.

5329857--536955--tmp1.PNG

Images attached for more details. Any help is much appreciated.

The official documentation is hosted on the original author’s website.

Hope that helps!

P.S: For future reference, support questions should go in the relevant subforum. General Discussion is specifically not a support area.

1 Like

Hi @angrypenguin please don’t be mad but just want to verify. So it has to be a sprite sheet? Cause i only want to use 1 sprite image.

and noted about the subforums. thanks!

I haven’t double checked, but I assume so. It’s ok to have a sprite sheet with just one sprite in it.

Most people will need more than one sprite, and it would be inefficient for TMP to load every image separately, so encouraging you to put them all on shared sheets makes a lot of sense.

Ahhh… Okay! Figured it out via the links u shared. Thanks! New to setting up sprites well to unity sort of. Thank you.

So for future reference (Coz I’m dumb like that):

Basically, if its just one image you can still set it as multiple then in the Sprite Editor just size the transform box to fit the image you want. Note the name of the sprite when you are doing this.

Then on the image, right click on it Create > Text Mesh Pro > Sprite Asset and it will create the sprite asset which will have the same name as the image but with like a blue icon with an S. I moved it to Assets / Text Mesh Pro / Resources / Sprite Assets , this step needs to be done in order for it to work.

Then in your Text Mesh Pro in the text field use <sprite="name of sprite atlas" name="name in sprite character table">

Then you may handle it positioning etc in the Sprite Glyph Table

And done. Tada!

8 Likes