Ambiguation between multitouch geistures tap and free drag in Windows Phone 8 Emulator (Monogame)
Posted
by
Moses Aprico
on Game Development
See other posts from Game Development
or by Moses Aprico
Published on 2013-06-29T16:44:49Z
Indexed on
2013/06/29
22:29 UTC
Read the original article
Hit count: 505
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.
© Game Development or respective owner