Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

TextMesh Pro New <gradient> Rich Text Tag

Discussion in 'Unity UI & TextMesh Pro' started by Stephan_B, Nov 29, 2017.

  1. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,160
    Added a new rich text tag <gradient> </gradient> which makes it possible to assign a Color Gradient Preset on the text enclosed between those two tags.

    The format for the tag is as follow: <gradient="Name of Color Gradient Preset">Some text</gradient>

    Since these Color Gradient Presets will need to be loaded at runtime and similar to other TMP assets, these have to be located within a Resources folder. The specific location within Resources folders can be defined in the TMP Settings file.

    Here is an example using this new tag.



    Raw input text
    upload_2017-11-28_17-14-46.png

    Please note <gradient> tags can also be nested like many other tags in TMP.

    This new feature will be in the next release of TMP which should be available later tonight. You will find direct links to download these new releases in the top sticky post in the Unity UI & TextMesh Pro section of the user forum. These releases will also be available thru the asset store within the next few days. As usual be sure to read the Release and Upgrade notes and to always back up your project before upgrading to new releases.
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,714
    Always cool to see nice updates & improvements to this cool asset / part of Unity ;)
     
  3. Lukasland

    Lukasland

    Joined:
    Feb 1, 2018
    Posts:
    1
    Possible to get this to work with sprites?
    Thank you!
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,160
    I just made the change where the <gradient> tag will also color the sprites provided the tint attribute is set to 1 as per the example below.

    A <gradient="Yellow to Orange - Vertical"><sprite="DropCap Numbers" index=0 tint=1> <sprite="DropCap Numbers" index=0 tint=0></gradient> B

    upload_2018-3-16_13-30-43.png

    This change will be in the next release of the TMP UPM package for Unity 2018.1.
     
    Last edited: Mar 16, 2018
  5. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    4,224
    I was just playing with the gradient setting.
    It seems to be a per letter gradient, but is there a way to get it to be a gradient over the entire word? So that it goes from left to right and changes colors. Also, I noticed the gradient doesn't seem to affect the underline, which is still white. Is there a way to apply that to the underline?
     
    NeatWolf likes this.
  6. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    4,224
    Solved this just using a material with a square gradient made in photoshop.
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,160
    Feature request noted in regards to both having the gradient tag apply to the characters enclosed in the tag and better handling for the underline.