Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Cant use mark and color i one rich text

Discussion in 'Scripting' started by loiuy538, May 25, 2020.

  1. loiuy538

    loiuy538

    Joined:
    May 25, 2020
    Posts:
    3
    Hello there!
    I tried using rich text, what i wanted to achive is green text with yellow highlight
    "<mark=#FF8800><color=green>letter</color></mark>";

    so i tried doing something like this ^
    But letters are invisible, only highlight is visible.

    Any ideas whats wrong?
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,150
    With TextMeshPro, the mark tag draws the text first and then the "highlight" color. If you highlight is not transparent, it will cover the text. You need to add transparency to your # code.
     
  3. loiuy538

    loiuy538

    Joined:
    May 25, 2020
    Posts:
    3
    Thanks.

    Thats pretty stupid to be honest. Highlight should be draw first, then text
     
  4. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,150
    I know the TMP guy mentioned why it was like that and explained why he couldn't change it. I agree it's an odd design flaw in my opinion. We ended up going with a different design instead to get a better effect as the highlight being on top of the text doesn't allow the text to be as clear.