Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Tomleung on June 24, 2014, 05:19:39 AM

Title: Do NGUI support swiping functions?
Post by: Tomleung on June 24, 2014, 05:19:39 AM
NGUI has OnClick(), OnHover()......, but how about Swiping ?

If I want use swiping on the user interface or any gameobjects, do NGUI support for this?

Thank you.
Title: Re: Do NGUI support swiping functions?
Post by: ArenMook on June 25, 2014, 04:45:11 AM
NGUI doesn't have built-in gesture recognition, but it's easy to do so by setting UICamera.genericEventHandler. This object will get a copy of all the events, letting you listen to OnPress/OnDrag etc, and do gesture recognition easily.
Title: Re: Do NGUI support swiping functions?
Post by: Tomleung on June 25, 2014, 07:38:44 AM
NGUI doesn't have built-in gesture recognition, but it's easy to do so by setting UICamera.genericEventHandler. This object will get a copy of all the events, letting you listen to OnPress/OnDrag etc, and do gesture recognition easily.

Can you make a tutorial for using UICamera.genericEventHandler?
It is because I don't know how to use it,
especially for this case.
Title: Re: Do NGUI support swiping functions?
Post by: ArenMook on June 25, 2014, 07:56:27 AM
Simply set it to be some game object. This game object will be receiving all of the events -- OnPress, OnClick, etc as if you were clicking on it the entire time.