Author Topic: Alternating a button image on press?  (Read 4657 times)

derkoi

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 57
    • View Profile
Alternating a button image on press?
« on: May 30, 2012, 03:00:39 PM »
Is there a way to alternate a button image on press, so every time it gets pressed it goes from say a stripy button to a plain button then back to a stripy button if its pressed again and so on?

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Alternating a button image on press?
« Reply #1 on: May 30, 2012, 03:54:58 PM »
Just create a script has has an OnClick() and swaps the sprite there.

derkoi

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 57
    • View Profile
Re: Alternating a button image on press?
« Reply #2 on: June 01, 2012, 03:33:03 AM »
I actually ended up using the UICheckbox. Just removed the fade between images. Works perfectly.  :)

I must say I'm really enjoying working with NGUI, I'm having to convert an existing UI made with Prime31s UIToolkit because for some reason UIToolkit doesn't display on the Motorola Droid Bionic.  ???