0
\$\begingroup\$

I've been around xna game development since very recently, and I'm actually developing a sort of Library for my games. But then I want to make an enemy with default Player settings for keys layouts and stuff. I've managed to create one for Qwerty and Azerty but I also want to create one for gamepad Controllers. Here comes the problem. The default XNA Input Framework is very limited (I think) because, from what I saw, it only manages few buttons that do not include Dpad or Joysticks.

So, is there a way to manage them in xna? or do I need an external Library?

Thanks for your help;

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

Turned out I did not searched enough when I posted this, actually there is a way to get sticks and other inputs from your controller.

Here are several things that might help you if you are in situation than I was lately.

With the Microsoft.XNA.Framwork.Input you have these:

GamePad.GetState(id).Thumbstick -> this is your sticks

From there you can choose either
GamePad.GetState(id).Thumbstick.Left
or
GamePad.GetState(id).Thumbstick.Right

then you can get from both the X and Y position
GamePad.GetState(id).Thumbstick.Left.X || GamePad.GetState(id).Thumbstick.Left.Y

it's all in the default XNA Framework Input.

you can check every states of every inputs after your GetState(id) by simply searching in the variables that the GamePadState class offers.

Have a nice day

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .