Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: ronronmx on September 22, 2012, 01:45:28 AM
-
Hi guys, i'm new here, and also a new user of NGUI, and I have a few questions...
I have a DetectInput() class which checks for thumb slides. I get the start Vector2 of the slide when calling 'TouchPhase.Began', and then check for the position of the slide in 'TouchPhase.Moved', and if 'slideEnd - slideStart > 200' I then do something.
Does NGUI have a built-in way to check for TouchPhases? I can get the position of the swipe by using 'OnDrag(Vector2 delta)', but how can I check for the delta position when the swipe starts, for example in 'OnPress(bool isPressed)' since it doesn't have a Vector2 parameter?
I don't want to start mixing my touch detection code with NGUI's, so if I can do everything the same with NGUI then I'd rather do that.
Thanks for your time!
Stephane
-
UICamera.currentTouch.pos tells you the current position of the touch action inside an NGUI event callback such as OnDrag. UICamera.currentTouch.totalDelta tells you the delta since OnPress(true).
-
UICamera.currentTouch.pos tells you the current position of the touch action inside an NGUI event callback such as OnDrag. UICamera.currentTouch.totalDelta tells you the delta since OnPress(true).
Got it, thanks!