GamePadInfo
Namespace: MonineEngine.Input
public class GamePadInfo
Inheritance Object → GamePadInfo
Properties
PlayerIndex
The index of the player this gamepad is for.
public PlayerIndex PlayerIndex { get; }
Property Value
PlayerIndex
PreviousState
The state of input for this gamepad during the previous update cycle.
public GamePadState PreviousState { get; private set; }
Property Value
GamePadState
CurrentState
The state of input for this gamepad during the current update cycle.
public GamePadState CurrentState { get; private set; }
Property Value
GamePadState
IsConnected
Whether this gamepad is currently connected or not.
public bool IsConnected { get; }
Property Value
LeftThumbStick
The value of the left thumbstick of this gamepad.
public Vector2 LeftThumbStick { get; }
Property Value
Vector2
RightThumbStick
The value of the right thumbstick of this gamepad.
public Vector2 RightThumbStick { get; }
Property Value
Vector2
LeftTrigger
The value of the left trigger of this gamepad.
public float LeftTrigger { get; }
Property Value
RightTrigger
The value of the right trigger of this gamepad.
public float RightTrigger { get; }
Property Value
Constructors
GamePadInfo(PlayerIndex)
Constructs a new GamePadInfo for the gamepad connected at the specified player index.
public GamePadInfo(PlayerIndex playerIndex)
Parameters
playerIndex PlayerIndex
The index of the player for this gamepad.
Methods
Update(GameTime)
Updates the state information for this gamepad input.
public void Update(GameTime gameTime)
Parameters
gameTime GameTime
A snapshot of the timing values for this frame.
IsButtonDown(Buttons)
Checks for if the specified gamepad button is current down.
public bool IsButtonDown(Buttons button)
Parameters
button Buttons
The gamepad button to check.
Returns
Boolean
true if the specified gamepad button is currently down; otherwise, false.
IsButtonUp(Buttons)
Checks for if the specified gamepad button is currently up.
public bool IsButtonUp(Buttons button)
Parameters
button Buttons
The gamepad button to check.
Returns
Boolean
If the specified gamepad button is currently up, true. Otherwise, false.
WasButtonPressed(Buttons)
Checks for if the specified gamepad button was just pressed on the current frame.
public bool WasButtonPressed(Buttons button)
Parameters
button Buttons
The gamepad button to check.
Returns
Boolean
If the specified gamepad button was just pressed on the current frame, true. Otherwise, false.
WasButtonReleased(Buttons)
Checks for if the specified gamepad button was just released on the current frame.
public bool WasButtonReleased(Buttons button)
Parameters
button Buttons
The gamepad button to check.
Returns
Boolean
If the specified gamepad button was just released on the current frame, true. Otherwise, false.
SetVibration(Single, TimeSpan)
Sets the vibration for this gamepad.
public void SetVibration(float strength, TimeSpan time)
Parameters
strength Single
The strength of the vibration from 0.0f (none) to 1.0f (full).
time TimeSpan
The amount of time the vibration should occur for.
StopVibration()
Stops the vibration of all motors for this gamepad.
public void StopVibration()