Author Topic: Recreating iOS interaction paradigm w/ NGUI is proving to be a challenge  (Read 3857 times)

burtonposey

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Hey there,

I am trying to create the UI interaction where a user presses on a button and then leaves the interactive area of that button and the button stops responding. At the very least I'd love to have NUI not follow through on a button press that is wired to fire "OnRelease" when I release on something other than the GameObject. I've spent the past two hours trying to find out who calls the shots in the event flow for NGUI, but I can't figure out where to rewrite the code to make this happen. I know the way it's written right now, it doesn't matter where I "OnRelease", NGUI is pretty hellbent on "OnRelease"ing from the button I first pressed. I personally think this is flawed logic, and is definitely counter to the iOS UX.

I've tried to think of some workarounds, but I really need to figure out who is keeping OnHover(GameObject, false) from getting back to the button while it's pressed. This is where the UX starts to deviate from the iOS interaction paradigm.

Thanks so much for the help. I hate having to bother anyone else, but I just haven't been able to figure out where things are definitively happening in the NGUI event flow.

Take care - Burton

dlewis

  • Guest
You'll want to check out UICamera.cs, it's what handles the events.

I use OnSelected (slightly modified) to handle 'press up on same button'. From what I remember, onHover is only for the mouse so you would have to modify it to be able to detect what you are over when pressed.

burtonposey

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Cool. Thanks for the tips. I'll take a look at the UICamera code tonight.