Beispiel #1
0
    public void RemapUsingJoystick(CustomAxisCode axisCode = CustomAxisCode.Null)
    {
        if (axisCode == CustomAxisCode.Null)
        {
            return;
        }

        if (axisCode == CustomAxisCode.LeftJoystickX || axisCode == CustomAxisCode.RightJoystickX)
        {
            // Change joystick action to left joystick (so X and Y)
        }

        if (axisCode == CustomAxisCode.RightJoystickX || axisCode == CustomAxisCode.RightJoystickX)
        {
            // Change joystick action to right joystick (so X and Y)
        }
    }
Beispiel #2
0
    public float?GetAxisState(CustomAxisCode _ca, PlayerIndex _index)
    {
        GamePadState i_state = GamePad.GetState(_index);

        switch (_ca)
        {
        case CustomAxisCode.LeftJoystickX:
            return(i_state.ThumbSticks.Left.X);

        case CustomAxisCode.LeftJoystickY:
            return(i_state.ThumbSticks.Left.Y);

        case CustomAxisCode.RightJoystickX:
            return(i_state.ThumbSticks.Right.X);

        case CustomAxisCode.RightJoystickY:
            return(i_state.ThumbSticks.Right.Y);

        default:
            return(null);
        }
    }