edit: since nobody answered yet, I fixed it myself. The original intent of posting this was still to get a review and ask for alternatives, so not much really change...
Using
NGUI 2.7.0 here.
About the
NGUI Events, I've missed 2 kind of events:
-
OnMouseUp : because
OnPress(false) is actually equivalent to
OnMouseUpAsButton-
OnHover while OnPress : no idea why it was not implemented
Since I couldn't find a good way around it, I've implemented them on
UICamera.
For the
first part, it was easy. I've added a whole line to 1164, right after
if (unpressed), and a whole new convention for a equivalent to
OnMouseUp, which works both for Mouse and Tap on tablets:
Notify(currentTouch.current, "OnPressUp", null);
After I did that, just recently,
ArenMook gave me another way of doing it: UICamera Sticky Press. But I still prefer this one.

For the
second part, it was a lot tougher (to make it work on tablets)! I've basically changed 2 lines (923 and 952) under the method
ProcessMouse replacing
!isPressed by
(useTouch || !isPressed) - basically saying "if use mouse and use touch, consider is hover regardless of is pressed". I think it makes sense, and it worked.
This is how my
UICamera:923 looks now:
// The button was released over a different object -- remove the highlight from the previous
if (useMouse && (useTouch || !isPressed) && mHover != null && mHover != mMouse[0].current)
But it did not work on mobile / tablets. So I got stuck without a solution for hours... Finally, I got to some solution I'm not completely happy with, only because I think it's modifying too many lines (about 5). Basically I added a "or"
useTouch verification in some places where there was only a
useMouse and it was dealing with
hover, some how. I think it's too much to try and show here.
Should I post the whole file here? Is there another way to achieving all this?