【问题标题】:Multi-touch events in XNAXNA 中的多点触控事件
【发布时间】:2011-03-08 06:42:54
【问题描述】:

我需要在 xna 中同时应用多点触控事件(垂直拖动、水平拖动)。有知道的请帮忙。

【问题讨论】:

  • 我想我需要在 meta 上打开一个请求,将 Title 更改为 Question Title,以便清楚它应该是什么类型的标题。
  • @BoltClock:不得不嘲笑那个评论,虽然水印还不够吗?无论如何都会想...
  • @Brad Christie:你的意思是占位符文本“你的编程问题是什么”?是的,我也是这么想的……
  • @BoltClock:请不要!它让我每次都发笑

标签: c# xna


【解决方案1】:

我使用手势作为水平,垂直拖动,这是一个例子:

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;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-16
    • 2014-02-13
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多