Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

<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:
    748
    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,596
    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:
    748
    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,596
    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.