Ambiguation between multitouch geistures tap and free drag in Windows Phone 8 Emulator (Monogame)
- by Moses Aprico
I am making a 2d tile based tactic game. I want the map to be slided around (because it's bigger than the screen) with FreeDrag (It's perfectly done, the map can moved around, that's not the problem).
And then, I want to display the character's actions, everytime it's tapped.
The problem then appeared. Everytime I want to FreeDrag the map, the Tap trigger always fired first before the FreeDrag one. Is there any way to differ the map sliding than the character tapping? Below is my code.
while (TouchPanel.IsGestureAvailable)
{
GestureSample gesture = TouchPanel.ReadGesture();
switch (gesture.GestureType)
{
case GestureType.FreeDrag:
{
//a
} break;
case GestureType.Tap:
{
//b
} break;
}
}
Every time I first want to free drag (at the first touch), it always goes to "b" first (see commented line above), and then to "a" rather than immediately goes to "a".
I've tried flick, but it seems the movement produced by flick is too fast, so freedrag fits the most.
Is there any way or workaround to perform FreeDrag (or similar) without firing the Tap trigger?
Thanks in advance.