Search Unity

  1. We would like to hear your feedback about Unity and our products. Click here for more information.
    Dismiss Notice

TextMesh Pro Added new tint attribute to <gradient> tag.

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by Stephan_B, May 19, 2019.

  1. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,806
    As requested by several users, I finally got around to adding control over whether the text affected by a <gradient="Gradient Preset"> tag will be affected by vertex color or the <color> tag.

    Similar to how you can add the tint attribute to the <sprite> tag, you can now also use the tint attribute with the <gradient> tag.

    The format is as follows: <gradient="Gradient Preset" tint=0>
    With tint=0 (default behavior if attribute is omitted), the vertex color or the <color> tag will not affect / tint the gradient whereas with tint=1, the vertex color or <color> tag will tint the gradient.

    In both cases, the vertex color or <color> tag's alpha value will continue to affect the gradient to ensure you can still fade text in-and-out.

    In the example below, the vertex color is set to light yellow. The gradient is light blue to some darker blueish tint. Notice how the "tint=1 attribute" text is affected by this yellow vertex color.

    upload_2019-5-19_1-35-56.png

    upload_2019-5-19_1-37-20.png

    This new functionality will be included in version 1.4.2 for Unity 2018.3 & Unity 2018.4 and 2.0.2 for Unity 2019.x.