Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

<sprite> tag not accepting color=#ffffff or tint=1?

Discussion in 'UGUI & TextMesh Pro' started by funkyCoty, Oct 21, 2019.

  1. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    719
    The documentation ( http://digitalnativestudios.com/textmeshpro/docs/rich-text/#sprite ) shows that you can add tint=1 to make a sprite follow vertex color rules, or color=#ffffff to tint the sprite manually. However, both of these options no longer seem to work.

    I'm using the package manager version of TMP (2.0.1) on Unity 2019.2.1f1

    Are these features removed, or could something else be wrong?

    (example screenshots below)

    upload_2019-10-21_11-29-39.png

    upload_2019-10-21_11-29-54.png

    upload_2019-10-21_11-30-8.png
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Make sure you are using quotes when specifying the name or sprite asset.

    Example:

    <color=#ff8000><sprite name="Grinning face" tint=1>

    Quotes are used to separate values like the name from other attributes. In your case, the name of the sprite ends up being combined with the tint attribute.
     
  3. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    719
    Thanks! That was the trick. I almost wish that it didn't work at all without the ""s, so the confusion wouldn't exist. Too late now, I suppose, haha.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Whenever you see the tag text itself instead of the expected result, that is a sign of an improperly formatted tag or that something isn't right with the tag or its values.