Search Unity

Button: Rendered image color different from color property

Discussion in 'UGUI & TextMesh Pro' started by jashan, Jan 8, 2015.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I'm currently trying to get a non-rectangular button right and the way I do this is by having several RectTransforms as children of the button which extend the main area. So far, things go well.

    The tricky part is that I want to update the color of the child Images which render parts of the button based on the Color Tint transition. It turns out that Image.color apparently isn't changed by the Button component and yet another color is rendered.

    So the most obvious approach of grabbing the color on the Image component that's attached together with the Button component and pushing that color to the child Images doesn't work. I've looked at the API and wasn't able to find a way to get this "temporary" color.

    So ... how should that be approached?