Draw.Text outline

Avatar
  • updated
  • Under Consideration

Hi there!

Firstly, I really love Shapes. It makes my life a lot easier, thank you for that <3

One thing I'm missing though is the "outline feature" that TMP has. The current Draw.Text is quite limiting, because there's a change that the text blends with the background of similar color. Outlines would guarantee that the text will always stand out.

If it's not too much to ask, it would be great to have that feature in the future updates.

Thanks!

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
Freya Holmér creator
  • Under Consideration

this one is a little hard to do inline in immediate mode, as changing outline requires instantiating a separate material, but maybe I can find a solution in the future

Avatar
richard

An outline effect for text would be awesome. I searched for this as well.

In the meantime maybe work around with a drop shadow can help as a temporary solution.
I created 2 TextMeshPro-Assets. The one for the drop shadow has a slight baseline shift (see inspector screenshot below).

In immediate mode drawing I draw the dark text for the drop shadow text (with its drop-shadow-TMP-font-asset) first and the white text (baseline = 0) on top of it. This is the only difference between the two Draw.Text() commands. The font size, position, alignement, text, etc. are equal for both.

The code looks something like this:

Draw.Text(..., darkOutlineFontAsset, ...)   // first text for the drop shadow effect (baseline = -2)
Draw.Text(..., whiteFontAsset, ...)         // second text for the white text on top (baseline = 0)

I use this method of drawing something dark and larger beneath something brighter for all the lines and disc as well, so that everything has an "outline" effect (see screenshot).

Thanks a lot for creating "Shapes". Its a great asset :).


Best regards,

richard

Image 716

Image 717