XNA C # Controller Input Structures

I have scanned the entire network and need some help. Is there a link somewhere, for example, the code of all the buttons for the Xbox 360 controller. For example:

if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
    this.Exit();

I know this will exit the game if you click on the controller.

I just need state examples for the joystick, d-pad and all buttons.

+3
source share
2 answers

Have you checked the MSDN XNA input documentation ? It really has no examples, but it looks like you have an idea of ​​what you are doing with the inputs.

The articles have all the information about the inputs.

All controller buttons with which you can go throughGamePad.GetState(PlayerIndex.One).Buttons

Joystick that you can go throughGamePad.GetState(PlayerIndex.One).Thumbsticks

D-Pad, GamePad.GetState(PlayerIndex.One).DPad

+6

, .

: , UP this frame DOWN last frame, , .

, . IGameComponent Game .

+1

All Articles