C# Class FlatRedBall.Input.Xbox360GamePad

显示文件 Open project: vchelaru/FlatRedBall Class Usage Examples

Public Methods

Method 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

Method Description
Update ( ) : void
UpdateAnalogStickAndTriggerValues ( ) : void
UpdateInputManagerBack ( ) : void
UpdateLastButtonPushedValues ( ) : void
Xbox360GamePad ( PlayerIndex playerIndex ) : System

Method Details

AnyButtonPushed() public method

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

ButtonDown() public method

public ButtonDown ( Button button ) : bool
button Button
return bool

ButtonPushed() public method

public ButtonPushed ( Button button ) : bool
button Button
return bool

ButtonReleased() public method

public ButtonReleased ( Button button ) : bool
button Button
return bool

ButtonRepeatRate() public method

public ButtonRepeatRate ( Button button ) : bool
button Button
return bool

ButtonRepeatRate() public method

public ButtonRepeatRate ( Button button, double timeAfterPush, double timeBetweenRepeating ) : bool
button Button
timeAfterPush double
timeBetweenRepeating double
return bool

Clear() public method

public Clear ( ) : void
return void

ControlPositionedObject() public method

public ControlPositionedObject ( PositionedObject positionedObject ) : void
positionedObject PositionedObject
return void

ControlPositionedObject() public method

public ControlPositionedObject ( PositionedObject positionedObject, float velocity ) : void
positionedObject PositionedObject
velocity float
return void

ControlPositionedObjectAcceleration() public method

public ControlPositionedObjectAcceleration ( PositionedObject positionedObject, float acceleration ) : void
positionedObject PositionedObject
acceleration float
return void

ControlPositionedObjectDPad() public method

public ControlPositionedObjectDPad ( PositionedObject positionedObject, float velocity ) : void
positionedObject PositionedObject
velocity float
return void

ControlPositionedObjectFpsStyle() public method

public ControlPositionedObjectFpsStyle ( PositionedObject positionedObject, Vector3 up ) : void
positionedObject PositionedObject
up Vector3
return void

CreateDefaultButtonMap() public method

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
return void

GetButton() public method

public GetButton ( Button button ) : Xbox360ButtonReference
button Button
return Xbox360ButtonReference

IgnoreButtonForOneFrame() public method

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.
return void

SetVibration() public method

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
return bool

ToString() public method

public ToString ( ) : string
return string

Update() public method

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.
return void