So I need help with using sprites inside TextMeshPro UI text. I want to make button prompts (e.g. “Press Y to interact”) so I decided to use TextMeshPro’s < sprite > tag. But there is some kind of scaling problem, and I can’t seem to figure out where. The pixels have inconsistent sizes.
At first I thought it was related to the camera settings but they are all set properly (or at least I think they are). For some reason the Pixel Perfect camera doesn’t help, it actually makes it look worse.
Here is a close-up of the issue. The sprite pixels should all be 3x3 real pixels in size but you can see some are 3x2 or even 2x2. Notice that below the text I placed a simple UI image with the same sprite, which doesn’t have scaling problems:
Here are my settings:
PPU: 16 (both on Canvas and on import settings)
Game resolution: 640x360
Display resolution: 1920x1080
Orthographic camera size: 11,25 (half of the height / PPU)
No anti aliasing, no compression or filter mode on the sprite
Sprite size is 16x16
My best guess is that there is something wrong with the text size itself. I’m not very good with UI but still, it should be fairly easy to upscale the text with these resolutions, so I don’t know why it doesn’t work.
Also, I have another question, maybe less technical: what is the best way to use World Space canvas, in terms of the canvas scale etc. The text is too big for my liking but it is already set to font size 1, and I also can’t scale the sprite down because I would lose pixels. In other words: how do I make the text smaller, without losing on sprite quality?