Home > Net >  How highlight text with spacing in Unity without TMP #mark tag
How highlight text with spacing in Unity without TMP #mark tag

Time:10-12

How do I highlight text with spacing in Unity like in this pictures

text layout that I want to achieve

I've used a TMP mark tag, but it doesn't work the way I would expect it to, it ends up drawing on top of the text instead of behind it, and it can't be resized

Me tried: <mark=#006CFFaa>100</mark>

Result:

enter image description here

The text is not bright, as if the highlight is all over the text, but it has become more transparent

Also can there be a way to make rounded as picture? May be other methods not TMP?

CodePudding user response:

I get the following result:

Mark

using the following code:

  GetComponent<TextMeshProUGUI>().text = "Text <mark=#ffff00aa>can be marked with</mark> an overlay"

As the length can be controlled; nevertheless, as stated using Image

UPDATE 2: what if you put two text mesh pros on top of each other, and marker down the one on the back. it gives reuslts like this:

UPDATE 3

  • Related