Exemplo n.º 1
0
 private bool IsGamePadStickTriggered(GamePadAnalogTrigger trigger)
 {
     switch (trigger.Analog)
     {
     case GamePadAnalog.LeftThumbStick:
         trigger.Position = GetLeftThumbStick();
         break;
     case GamePadAnalog.RightThumbStick:
         trigger.Position = GetRightThumbStick();
         break;
     case GamePadAnalog.LeftTrigger:
         trigger.Position = new Vector2D(GetLeftTrigger(), GetLeftTrigger());
         break;
     case GamePadAnalog.RightTrigger:
         trigger.Position = new Vector2D(GetRightTrigger(), GetRightTrigger());
         break;
     }
     return trigger.Position != Vector2D.Unused;
 }
Exemplo n.º 2
0
        private bool IsGamePadStickTriggered(GamePadAnalogTrigger trigger)
        {
            switch (trigger.Analog)
            {
            case GamePadAnalog.LeftThumbStick:
                trigger.Position = GetLeftThumbStick();
                break;

            case GamePadAnalog.RightThumbStick:
                trigger.Position = GetRightThumbStick();
                break;

            case GamePadAnalog.LeftTrigger:
                trigger.Position = new Vector2D(GetLeftTrigger(), GetLeftTrigger());
                break;

            case GamePadAnalog.RightTrigger:
                trigger.Position = new Vector2D(GetRightTrigger(), GetRightTrigger());
                break;
            }
            return(trigger.Position != Vector2D.Unused);
        }