Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Change Text colour along with button colour

Discussion in 'UGUI & TextMesh Pro' started by kurai, Mar 17, 2015.

  1. kurai

    kurai

    Joined:
    Jan 9, 2012
    Posts:
    118
    Hi there,
    I've just made a simple button with the new UI.

    Since the button right now is not filled (it shows only the contour), but it still changes colour when hovered/pressed/deactivated I would like to change the colour likewise to the button text. Is there an easy way to sync the two colours without using a selectable script in the text as well?

    I have some padding in the button's text, so the selectable script won't be the best solution: I would always have some space where the button changes colour on hover but the text does not.

    Any ideas?
     
  2. Feaver1968

    Feaver1968

    Joined:
    Nov 16, 2014
    Posts:
    70
    I think you would need a second button script on the image that animates the text color on hover etc.