Hi guys, I'm using the Soopah.Xna dll for making PC gamepads work. So far everything
works great except for the directional pad. I keep getting errors
Line 19 is where I'm getting the error and it says
- Cannot implicitly convert type 'Microsoft.Xna.Framework.Input.ButtonState' to 'bool'
Any thoughts on how to fix this?
| 1 |
#region GAMEPAD |
| 2 |
// PC Gamepad Controls Logic added here |
| 3 |
|
| 4 |
lastGamePadState = currentGamePadState; |
| 5 |
currentGamePadState = TestingGrounds.PCGamePad.GetState(PlayerIndex.One); |
| 6 |
|
| 7 |
// Allows the game to exit |
| 8 |
if (TestingGrounds.PCGamePad.GetState(PlayerIndex.One).Buttons.Start == ButtonState.Pressed) |
| 9 |
this.Exit(); |
| 10 |
|
| 11 |
// Allows the game to exit |
| 12 |
if (lastGamePadState.Buttons.Select == ButtonState.Released && |
| 13 |
currentGamePadState.Buttons.Select == ButtonState.Pressed) |
| 14 |
{ |
| 15 |
this.Exit(); |
| 16 |
} |
| 17 |
|
| 18 |
// Change the sprite 2 position using the D-Pad |
| 19 |
if (TestingGrounds.PCGamePad.GetState(PlayerIndex.One).DPad.Up) |
| 20 |
Smiley2.position += new Vector2(0, -5); |
| 21 |
|
| 22 |
// Change the sprite 2 position using the left thumbstick |
| 23 |
Vector2 LeftThumb = TestingGrounds.PCGamePad.GetState(PlayerIndex.One).Thumbsticks.Left; |
| 24 |
Smiley2.position += new Vector2(LeftThumb.X, LeftThumb.Y) * 10; // # represents the speed of movement |
| 25 |
|
| 26 |
#endregion |