Microsoft.Xna.Framework.Input
Class GamePadState

java.lang.Object
  extended by System.ValueType
      extended by Microsoft.Xna.Framework.Input.GamePadState

public final class GamePadState
extends ValueType

Represents specific information about the state of an Xbox 360 Controller, including the current state of buttons and sticks.

Author:
Halofreak1990

Field Summary
 GamePadButtons Buttons
          Returns a structure that identifies what buttons on the Xbox 360 controller are pressed.
 GamePadDPad DPad
          Returns a structure that identifies what directions of the directional pad on the Xbox 360 Controller are pressed.
 boolean IsConnected
          Indicates whether the Xbox 360 Controller is connected.
 GamePadThumbSticks ThumbSticks
          Returns a structure that indicates the position of the Xbox 360 Controller sticks (thumbsticks).
 GamePadTriggers Triggers
          Returns a structure that identifies the position of triggers on the Xbox 360 controller.
 
Constructor Summary
GamePadState(GamePadThumbSticks thumbSticks, GamePadTriggers triggers, GamePadButtons buttons, GamePadDPad dPad)
          Initializes a new instance of the GamePadState class using the specified GamePadThumbSticks, GamePadTriggers, GamePadButtons, and GamePadDPad.
GamePadState(Vector2 leftThumbStick, Vector2 rightThumbStick, float leftTrigger, float rightTrigger, Buttons... buttons)
          Initializes a new instance of the GamePadState class with the specified stick, trigger, and button values.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns a value that indicates whether the current instance is equal to a specified object.
 int hashCode()
          Gets the hash code for this instance.
 java.lang.String toString()
          Retrieves a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Buttons

public final GamePadButtons Buttons
Returns a structure that identifies what buttons on the Xbox 360 controller are pressed. Reference page contains links to related code samples.


IsConnected

public final boolean IsConnected
Indicates whether the Xbox 360 Controller is connected. Reference page contains links to related code samples.


DPad

public final GamePadDPad DPad
Returns a structure that identifies what directions of the directional pad on the Xbox 360 Controller are pressed.


ThumbSticks

public final GamePadThumbSticks ThumbSticks
Returns a structure that indicates the position of the Xbox 360 Controller sticks (thumbsticks).


Triggers

public final GamePadTriggers Triggers
Returns a structure that identifies the position of triggers on the Xbox 360 controller.

Constructor Detail

GamePadState

public GamePadState(GamePadThumbSticks thumbSticks,
                    GamePadTriggers triggers,
                    GamePadButtons buttons,
                    GamePadDPad dPad)
Initializes a new instance of the GamePadState class using the specified GamePadThumbSticks, GamePadTriggers, GamePadButtons, and GamePadDPad.

Parameters:
thumbSticks - Initial stick state.
triggers - Initial trigger state.
buttons - Initial button state.
dPad - Initial directional pad state.

GamePadState

public GamePadState(Vector2 leftThumbStick,
                    Vector2 rightThumbStick,
                    float leftTrigger,
                    float rightTrigger,
                    Buttons... buttons)
Initializes a new instance of the GamePadState class with the specified stick, trigger, and button values.

Parameters:
leftThumbStick - Left stick value. Each axis is clamped between -1.0 and 1.0.
rightThumbStick - Right stick value. Each axis is clamped between -1.0 and 1.0.
leftTrigger - Left trigger value. This value is clamped between 0.0 and 1.0.
rightTrigger - Right trigger value. This value is clamped between 0.0 and 1.0.
buttons - Array or parameter list of Buttons to initialize as pressed.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Returns a value that indicates whether the current instance is equal to a specified object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object with which to make the comparison.
Returns:
true if the current instance is equal to the specified object; false otherwise.

hashCode

public int hashCode()
Gets the hash code for this instance.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code for this object.

toString

public java.lang.String toString()
Retrieves a string representation of this object.

Overrides:
toString in class java.lang.Object
Parameters:
String - representation of this object.