如何在同一时间读取两个手势。我目前正在开发一款游戏,其中两名玩家应该使用FreeDrag手势。注册两个FreeDrag手势
现在发生的是:
当玩家A开始,他是拖它完美的作品。如果玩家B然后也开始它的FreeDrag手势,则TouchPanel.ReadGesture();
不会注册它,直到玩家A的手势完成。
我使用下面的代码:
在Initialize()
TouchPanel.EnabledGestures = GestureType.FreeDrag;
在Update()
if (TouchPanel.IsGestureAvailable)
{
GestureSample touch = TouchPanel.ReadGesture();
if (touch.GestureType == GestureType.FreeDrag)
{
if (touch.Position.Y > GraphicsDevice.Viewport.Height/2)
{
//logic Player A here
}
else
{
//logic Player B there
}
}
}
您好,我注意到您参与了“医疗IT”堆栈交换,并认为您可能对此建议感兴趣 - > [医疗行业](http://area51.stackexchange.com/proposals/41370/healthcare-行业?referrer = kaxVuDLRWM_Z_15aCbzplg2) – 2012-06-26 15:15:46