C# Class FlatRedBall.Input.Xbox360GamePad

Afficher le fichier Open project: vchelaru/FlatRedBall Class Usage Examples

Méthodes publiques

Méthode Description
AnyButtonPushed ( ) : bool

Returns whether any button was pushed on this Xbox360GamePad. This considers face buttons, trigger buttons, shoulder buttons, and d pad.

ButtonDown ( Button button ) : bool
ButtonPushed ( Button button ) : bool
ButtonReleased ( Button button ) : bool
ButtonRepeatRate ( Button button ) : bool
ButtonRepeatRate ( Button button, double timeAfterPush, double timeBetweenRepeating ) : bool
Clear ( ) : void
ControlPositionedObject ( PositionedObject positionedObject ) : void
ControlPositionedObject ( PositionedObject positionedObject, float velocity ) : void
ControlPositionedObjectAcceleration ( PositionedObject positionedObject, float acceleration ) : void
ControlPositionedObjectDPad ( PositionedObject positionedObject, float velocity ) : void
ControlPositionedObjectFpsStyle ( PositionedObject positionedObject, Vector3 up ) : void
CreateDefaultButtonMap ( ) : void

Creates a ButtomMap for this controller using the default bindings. This is a quick way to simulate an Xbox360 controller using the keyboard.

This creates the following bindings: * Left analog stick = arrow keys * A button = A key * B button = S key * X button = Q key * Y button = W key * Left trigger = E key * Right trigger = R key * Left shoulder = D key * Right Shoulder = F key * Back button = Backspace key * Start button = Enter key This will not simulate that the controller is connected, so you will have to set FakeIsConnected to true if your game checks the connected state.

GetButton ( Button button ) : Xbox360ButtonReference
IgnoreButtonForOneFrame ( Button buttonToIgnore ) : void

Makes this Xbox360Gamepad ignore the argument button for the rest of the current frame.

SetVibration ( float leftMotor, float rightMotor ) : bool

Sets the vibration of the game pad.

ToString ( ) : string
Update ( GamePadState gamepadState ) : void

Updates the Xbox360Gamepad according to the argument gamepadState. This is publicly available for games which need to simulate Xbox360Gamepads.

This function is normally called automatically by the FlatRedBall Engine in its regular update loop. You only need to call this function if you want to override the behavior of the gamepad. Be sure to call this function after FlatRedBallServices.Update, but before any custom game logic (such as ScreenManager.Activity).

Private Methods

Méthode Description
Update ( ) : void
UpdateAnalogStickAndTriggerValues ( ) : void
UpdateInputManagerBack ( ) : void
UpdateLastButtonPushedValues ( ) : void
Xbox360GamePad ( PlayerIndex playerIndex ) : System

Method Details

AnyButtonPushed() public méthode

Returns whether any button was pushed on this Xbox360GamePad. This considers face buttons, trigger buttons, shoulder buttons, and d pad.
public AnyButtonPushed ( ) : bool
Résultat bool

ButtonDown() public méthode

public ButtonDown ( Button button ) : bool
button Button
Résultat bool

ButtonPushed() public méthode

public ButtonPushed ( Button button ) : bool
button Button
Résultat bool

ButtonReleased() public méthode

public ButtonReleased ( Button button ) : bool
button Button
Résultat bool

ButtonRepeatRate() public méthode

public ButtonRepeatRate ( Button button ) : bool
button Button
Résultat bool

ButtonRepeatRate() public méthode

public ButtonRepeatRate ( Button button, double timeAfterPush, double timeBetweenRepeating ) : bool
button Button
timeAfterPush double
timeBetweenRepeating double
Résultat bool

Clear() public méthode

public Clear ( ) : void
Résultat void

ControlPositionedObject() public méthode

public ControlPositionedObject ( PositionedObject positionedObject ) : void
positionedObject PositionedObject
Résultat void

ControlPositionedObject() public méthode

public ControlPositionedObject ( PositionedObject positionedObject, float velocity ) : void
positionedObject PositionedObject
velocity float
Résultat void

ControlPositionedObjectAcceleration() public méthode

public ControlPositionedObjectAcceleration ( PositionedObject positionedObject, float acceleration ) : void
positionedObject PositionedObject
acceleration float
Résultat void

ControlPositionedObjectDPad() public méthode

public ControlPositionedObjectDPad ( PositionedObject positionedObject, float velocity ) : void
positionedObject PositionedObject
velocity float
Résultat void

ControlPositionedObjectFpsStyle() public méthode

public ControlPositionedObjectFpsStyle ( PositionedObject positionedObject, Vector3 up ) : void
positionedObject PositionedObject
up Vector3
Résultat void

CreateDefaultButtonMap() public méthode

Creates a ButtomMap for this controller using the default bindings. This is a quick way to simulate an Xbox360 controller using the keyboard.
This creates the following bindings: * Left analog stick = arrow keys * A button = A key * B button = S key * X button = Q key * Y button = W key * Left trigger = E key * Right trigger = R key * Left shoulder = D key * Right Shoulder = F key * Back button = Backspace key * Start button = Enter key This will not simulate that the controller is connected, so you will have to set FakeIsConnected to true if your game checks the connected state.
public CreateDefaultButtonMap ( ) : void
Résultat void

GetButton() public méthode

public GetButton ( Button button ) : Xbox360ButtonReference
button Button
Résultat Xbox360ButtonReference

IgnoreButtonForOneFrame() public méthode

Makes this Xbox360Gamepad ignore the argument button for the rest of the current frame.
public IgnoreButtonForOneFrame ( Button buttonToIgnore ) : void
buttonToIgnore Button The button that should be ignored for the rest of the current frame.
Résultat void

SetVibration() public méthode

Sets the vibration of the game pad.
public SetVibration ( float leftMotor, float rightMotor ) : bool
leftMotor float The low-frequency motor. Set between 0.0f and 1.0f
rightMotor float The high-frequency motor. Set between 0.0f and 1.0f
Résultat bool

ToString() public méthode

public ToString ( ) : string
Résultat string

Update() public méthode

Updates the Xbox360Gamepad according to the argument gamepadState. This is publicly available for games which need to simulate Xbox360Gamepads.
This function is normally called automatically by the FlatRedBall Engine in its regular update loop. You only need to call this function if you want to override the behavior of the gamepad. Be sure to call this function after FlatRedBallServices.Update, but before any custom game logic (such as ScreenManager.Activity).
public Update ( GamePadState gamepadState ) : void
gamepadState GamePadState The state containing the data for this frame.
Résultat void