Author Topic: Keep UIButton highlighted  (Read 3093 times)

halsafar

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Keep UIButton highlighted
« on: May 21, 2014, 01:57:11 PM »
I have a set of buttons which represent tools, only one of which can be selected at a time.

I would like be able to keep the selected button highlighted and remove highlighting from the others.  For highlighting I was hoping to use a color but a second texture works too.

I tried UIToggle with a unique group and my UIButtons just disappeared and reappeared as I moused over them.

I can do what I want manually in code but I figured NGUI would support this.

halsafar

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Keep UIButton highlighted
« Reply #1 on: May 21, 2014, 02:42:20 PM »
Figured it out.

Widget+UIButton+UIToggle
- ButtonSprite
- SelectedSprite

Set the UIToggle sprite to SelectedSprite.

Make sure to use a unique toggle group.