playMaker

Author Topic: 'Swipe Gesture Event' and 'uGUI' on same screen [SOLVED]  (Read 1482 times)

ItzArranT

  • Playmaker Newbie
  • *
  • Posts: 45
'Swipe Gesture Event' and 'uGUI' on same screen [SOLVED]
« on: July 01, 2017, 11:00:57 AM »
On the main menu of my game, the Player can tap the screen anywhere to start playing (uGUI on click)

They can also swipe left to view another section of UI (Swipe Gesture Event).

My problem is: whenever I swipe, the device registers this as a tap, too, which means both the swipe AND the "tap to play" occur.

Is there a way of making the device respond to just one of these inputs??
« Last Edit: July 03, 2017, 06:32:08 AM by ItzArranT »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 'Swipe Gesture Event' and 'uGUI' on same screen
« Reply #1 on: July 03, 2017, 03:02:21 AM »
Hi,

The best way is to use a framework like EasyTouch, which will handle these kind of complex analysis of touch events and decide what has priority etc.

The problem is the following: when you tap, you get the tap event but dragging hasn't started yet, so usually you have a timer which check if the touch position has moved, if it hasn't it sends a tap event, if it has, then it's a drag, and potentially a swipe.

 so, the problem of swiping actions vs getting tap event is complex.

 one way to ease the complexity ( only slightly) is to only check for PointerUP events and not tap, which will garantee you don't get mixed up when the touch begins, but you still need a system when you get pointerUP to check if it was a tap, a drag or a swipe.


Bye,

 Jean

ItzArranT

  • Playmaker Newbie
  • *
  • Posts: 45
Re: 'Swipe Gesture Event' and 'uGUI' on same screen [SOLVED]
« Reply #2 on: July 03, 2017, 06:31:55 AM »
Hi Jean,

Thanks for the response- it's good to meet you.

The problem makes sense and it's good to be aware of it now.  It was only a minor UX issue regarding menu UI, so I'll simply cut the swipe interactivity and stick to buttons!

Thanks again