Background behind Text Lines?

Hi there,

How can i set a background behind text just like in this image?

Please advise

Hi @Stephan_B
Can you please assist here?

You should be able to either use the tag or to implement your own background by querying the textInfo of the individual text objects to determine the position and size of each background element to be placed behind the text.

There should be a few posts about the instantiation and positioning of background elements on the forum. Here is a link to an older post that should prove useful. I am not sure if this old implementation still works but it should get you in the ballpark if the tag doesn't work for you.

1 Like

Thank you very much, mark is great tag

Few questions:

  • Does highlight appear behind the text?
  • Can you please add possibility of marging for mark underlay so we can show either bigger or smaller (something like stikethrough) ?

The geometry of the tag is contained in the main text object where as such, it can appear behind the text. This is an issue that I will be addressing in the future.

In the meantime, there is a trick where you can assign a static font asset that only contains the underline character to the text object and then assign as local fallback another (either dynamic or static) font asset that contains all the other glyphs. This setup results in the underline being drawn first and the characters coming from the fallback over it.

The mark tag does include a padding attribute which can be used as follows:
A

1 Like

It’d be really great if support for appearing as underlay appear in weeks rather than months.
With this feature, and TMpro, ill be able to make some beautiful typography related experiences.
Thanks

Did a background mask (mask behind the text, or an underlay) get added to TextMeshPro at all? It would be a great feature, not only stylistically, but also to enhance reading on certain backgrounds.

Any update on this?

Any update on this?

Any update on this?

Any update on this?

1 Like

Any update on this?

Any update on this?

Hi there,
Any update on this feature? Really need it, or anyother workaround possible?

Any update on this?

Guessing there is still no update on this?

Any update on this?

1 Like