开发者

Multi-touch events in XNA

开发者 https://www.devze.com 2023-02-15 22:49 出处:网络
I n开发者_开发问答eed to apply multi touch events together(vertical drag,horizontal drag) in xna. If any one knows please help.I use the gesture as horizontal, vertical drag, this is an example :

I n开发者_开发问答eed to apply multi touch events together(vertical drag,horizontal drag) in xna. If any one knows please help.


I use the gesture as horizontal, vertical drag, this is an example :

while (TouchPanel.IsGestureAvailable)
{
  GestureSample gesture =TouchPanel.ReadGesture();
  if (gesture.GestureType == GestureType.VerticalDrag)
  {
     //insert the code here that execute when the event is detected
  }
}

this is the code in your update or your thread, however, you must declare this in your class

TouchPanel.EnabledGestures = GestureType.VerticalDrag;

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号