C# Класс FlatRedBall.Input.Xbox360GamePad

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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).

Приватные методы

Метод Описание
Update ( ) : void
UpdateAnalogStickAndTriggerValues ( ) : void
UpdateInputManagerBack ( ) : void
UpdateLastButtonPushedValues ( ) : void
Xbox360GamePad ( PlayerIndex playerIndex ) : System

Описание методов

AnyButtonPushed() публичный Метод

Returns whether any button was pushed on this Xbox360GamePad. This considers face buttons, trigger buttons, shoulder buttons, and d pad.
public AnyButtonPushed ( ) : bool
Результат bool

ButtonDown() публичный Метод

public ButtonDown ( Button button ) : bool
button Button
Результат bool

ButtonPushed() публичный Метод

public ButtonPushed ( Button button ) : bool
button Button
Результат bool

ButtonReleased() публичный Метод

public ButtonReleased ( Button button ) : bool
button Button
Результат bool

ButtonRepeatRate() публичный Метод

public ButtonRepeatRate ( Button button ) : bool
button Button
Результат bool

ButtonRepeatRate() публичный Метод

public ButtonRepeatRate ( Button button, double timeAfterPush, double timeBetweenRepeating ) : bool
button Button
timeAfterPush double
timeBetweenRepeating double
Результат bool

Clear() публичный Метод

public Clear ( ) : void
Результат void

ControlPositionedObject() публичный Метод

public ControlPositionedObject ( PositionedObject positionedObject ) : void
positionedObject PositionedObject
Результат void

ControlPositionedObject() публичный Метод

public ControlPositionedObject ( PositionedObject positionedObject, float velocity ) : void
positionedObject PositionedObject
velocity float
Результат void

ControlPositionedObjectAcceleration() публичный Метод

public ControlPositionedObjectAcceleration ( PositionedObject positionedObject, float acceleration ) : void
positionedObject PositionedObject
acceleration float
Результат void

ControlPositionedObjectDPad() публичный Метод

public ControlPositionedObjectDPad ( PositionedObject positionedObject, float velocity ) : void
positionedObject PositionedObject
velocity float
Результат void

ControlPositionedObjectFpsStyle() публичный Метод

public ControlPositionedObjectFpsStyle ( PositionedObject positionedObject, Vector3 up ) : void
positionedObject PositionedObject
up Vector3
Результат void

CreateDefaultButtonMap() публичный Метод

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
Результат void

GetButton() публичный Метод

public GetButton ( Button button ) : Xbox360ButtonReference
button Button
Результат Xbox360ButtonReference

IgnoreButtonForOneFrame() публичный Метод

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.
Результат void

SetVibration() публичный Метод

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
Результат bool

ToString() публичный Метод

public ToString ( ) : string
Результат string

Update() публичный Метод

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.
Результат void