Windows phone 8 使用D Pad&;启动Windows Phone 8

Windows phone 8 使用D Pad&;启动Windows Phone 8,windows-phone-8,xna,gesture,monogame,Windows Phone 8,Xna,Gesture,Monogame,我正在使用Monogame为Windows Phone 8创建一个游戏。如图所示,我想用两个屏幕控制器分别控制坦克的移动和射击速度 然而,我一次只能控制一个。我不能同时移动坦克和开火。我使用的是一个输入类,它管理输入。对于我的每一个输入 input.AddTouchGestureInput(playerMoveDrag, GestureType.FreeDrag, joystickMove.BoundingBoxRect); input.AddTouchTapInput(pla

我正在使用Monogame为Windows Phone 8创建一个游戏。如图所示,我想用两个屏幕控制器分别控制坦克的移动和射击速度

然而,我一次只能控制一个。我不能同时移动坦克和开火。我使用的是一个输入类,它管理输入。对于我的每一个输入

input.AddTouchGestureInput(playerMoveDrag, GestureType.FreeDrag,
        joystickMove.BoundingBoxRect);

input.AddTouchTapInput(playerFireTap, joystickFire.BoundingBoxRect, true);
那么,我如何同时检测两种不同的手势(自由拖动D键盘,轻触fire键盘)


我想出来了。没有我最初想的那么难!如果有人在同一条船上,这里是我的解决方案

我们读取原始的触摸数据,而不是像自由拖动那样使用手势。Windows Phone 8硬件似乎支持多达8个同时接触点

所以,我的代码的一部分,检测任何触摸屏上的位置

    public void GetTouchPoints()
    {
        TouchCollection touches = TouchPanel.GetState();

        for (int i = 0; i < touches.Count; i++)
        {
            Vector2 position = touches[i].Position;

            if (thumbstickMove.IsPointInside(position))
            {
                thumbstickMove.TouchLocation = position;
            }

            if (thumbstickFire.IsPointInside(position))
            {
                thumbstickFire.TouchLocation = position;
            }      
        }
    }
public void GetTouchPoints()
{
TouchCollection touchs=TouchPanel.GetState();
for(int i=0;i