Author Topic: NGUI Free Version: UIImageButton state doesn't change after panel re-enable  (Read 3401 times)

mikedok

  • Guest
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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
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.

mikedok

  • Guest
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.

merlin981

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
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

Yukichu

  • Full Member
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 8
  • Posts: 101
    • View Profile
UIButton.isEnabled = true/false is awesome.

merlin981

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
UIButton.isEnabled = true/false is awesome.

Thanks, that worked