Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: mikedok on August 02, 2013, 01:19:14 PM

Title: NGUI Free Version: UIImageButton state doesn't change after panel re-enable
Post by: mikedok on August 02, 2013, 01:19:14 PM
I started using the free version of NGUI as an evaluation copy.  I like it, so I've recommended my company purchase the full version.  Purchasing at my company can take a while so I've started work in the free version (2.0.7c).  Pardon me if my question is very basic, I'm still learning NGUI.

I've noticed the UIImageButton state doesn't update if you disable the panel the button is on then re-enable the panel.  Am I doing something wrong?  Or is there a function I need to call to reset the button state after re-enabling the panel?  Here is the series of events to recreate:

1.  On start, show Panel1 that contains a button called NextButton.
2.  Move the mouse cursor over NextButton:  button changes to hover state.
3.  Press NextButton on Panel1:
     a.  Panel1 is hidden using NGUITools.SetActive().
     b.  Panel2 that contains button called BackButton is shown using NGUITools.SetActive().
4.  Move the mouse cursor away from the now invisible NextButton.
4.  Press BackButton on Panel2:
     a.  Panel2 is hidden using NGUITools.SetActive().
     b.  Panel1 is shown NGUITools.SetActive().
5.  NextButton is now visible again, but is in hover state even though the mouse curser is not hovering over it.

If you now move the mouse cursor to hover over the button it stays in hover state.  If you move the mouse cursor off the button changes to normal state.

Thanks for any advice you can give on this.
Title: Re: NGUI Free Version: UIImageButton state doesn't change after panel re-enable
Post by: ArenMook on August 02, 2013, 08:10:40 PM
Free version doesn't come with support. It's dated May last year, so it's very old. Most issues there were already resolved in the full version long ago.
Title: Re: NGUI Free Version: UIImageButton state doesn't change after panel re-enable
Post by: mikedok on August 03, 2013, 10:16:04 AM
ArenMook, thanks for the reply.  Good to see that you are quick on replies.  Another reason to like the software.

I'll ignore the problem till I get the full version.  Thanks.
Title: Re: NGUI Free Version: UIImageButton state doesn't change after panel re-enable
Post by: merlin981 on February 28, 2014, 12:57:02 PM
I'm having a very similar issue with the full version of NGUI.

I have a button which displays a small popup when clicked. When the user clicks the button, I disable the button, then show the popup. When the popup is closed, I re-enable the button.

When the button is re-enabled, the sprite being drawn for the button is the Pressed sprite (same as when the button was disabled).

I'm disabling the button using:
  1. instance.ButtonToDisableOnPopup.collider.enabled = false

And enabling the button using:
  1. instance.ButtonToDisableOnPopup.collider.enabled = true
Title: Re: NGUI Free Version: UIImageButton state doesn't change after panel re-enable
Post by: Yukichu on February 28, 2014, 03:28:44 PM
UIButton.isEnabled = true/false is awesome.
Title: Re: NGUI Free Version: UIImageButton state doesn't change after panel re-enable
Post by: merlin981 on March 03, 2014, 11:26:47 AM
UIButton.isEnabled = true/false is awesome.

Thanks, that worked