Search Unity

Toggle Button with image

Discussion in 'UGUI & TextMesh Pro' started by Winklehner, Aug 23, 2014.

  1. Winklehner

    Winklehner

    Joined:
    Apr 12, 2013
    Posts:
    20
    Im using 5 Toggle's that are part of a ToggleGroup and each Toggle has an image as a target graphic. Transition is set to ColorTint. Highlighted & Pressed Color is set to blue.
    When I hover over the Toggle's they change color, if I press the mouse button, the active state is changed, however the Toggle doesn't stay colored when moving the mouse away. It changes back to normal color!?

    Is this a bug?
     
    Last edited: Aug 23, 2014
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    No that is the way the system is designed. What you want is more of sticky where it maintains the press state. You could always do this yourself by changing the behavior of the toggle class
     
  3. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    That's intended. The highlighting state is related to mouse over / mouse down ect not to the state of the toggle itself. If you look on the toggle there is a toggle transition and graphic. This is where you configure the overlay image to indicate the toggle is on.