Author Topic: Do NGUI support swiping functions?  (Read 1962 times)

Tomleung

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Do NGUI support swiping functions?
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Do NGUI support swiping functions?
« Reply #1 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.

Tomleung

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: Do NGUI support swiping functions?
« Reply #2 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Do NGUI support swiping functions?
« Reply #3 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.