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’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. 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:
    674
    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    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:
    674
    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    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.