我需要在 xna 中一起应用多点触控事件(垂直拖动、水平拖动)。如果有人知道请帮助。
最佳答案
我将手势用作水平、垂直拖动,这是一个示例:
while (TouchPanel.IsGestureAvailable)
{
GestureSample gesture =TouchPanel.ReadGesture();
if (gesture.GestureType == GestureType.VerticalDrag)
{
//insert the code here that execute when the event is detected
}
}
这是您的更新或线程中的代码,但是,您必须在您的类中声明它
TouchPanel.EnabledGestures = GestureType.VerticalDrag;
关于c# - XNA 中的多点触控事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5229223/