Search Unity

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


    Unity Technologies

    Feb 26, 2017
    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.



    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.