Hi good NGUI folks,
Maybe I'm missing something, but NGUI button press handling seems to make it very hard to support *standard* UI behavior:
1) I'd like to track and show a different state for the button depending on whether OnClick will be called if OnPress(false) happens. I've seen these states referred to as "armed" and "disarmed" before - armed means if I release the mouse button/finger it'll trigger the action of the button.
I'll need events to fire three different animations/tweens:
- OnArm(true) - show the button as in armed state (e.g., let the button shrink a little and darken)
- OnArm(false) - show the button in normal/disarmed state (e.g., let the button ease back into normal size & color)
- OnClick() - show the button activation (e.g., let the button pop and return to normal size & color)
It seems the only way to do this is to try to mimic the logic of OnClick in my own script, and do it incompatibly (see point 2 below for example). It seems this should be the normal behavior, so shouldn't NGUI support this out-of-the-box? (Or, let me know how to do it if I missed something!)
2) In NGUI, if I press down over a button, drag the mouse pointer out of the button, back in again, and then release OnClick is not fired. This isn't how most UIs that I know of work - they'll still trigger the action if you move the mouse pointer back into the button before you release.
See