Class GamePadDeviceExtensions
Provides easier ways to set vibration levels on a controller, rather than setting 4 motors
public static class GamePadDeviceExtensions
- Inheritance
-
GamePadDeviceExtensions
Methods
IsButtonDown(IGamePadDevice, GamePadButton)
Determines whether the specified button is being pressed down
public static bool IsButtonDown(this IGamePadDevice gamepad, GamePadButton button)
Parameters
gamepadIGamePadDeviceThe gamepad
buttonGamePadButtonThe button
Returns
- bool
trueif the specified button is being pressed down; otherwise,false.
IsButtonPressed(IGamePadDevice, GamePadButton)
Determines whether the specified button is pressed since the previous update.
public static bool IsButtonPressed(this IGamePadDevice gamepad, GamePadButton button)
Parameters
gamepadIGamePadDeviceThe gamepad
buttonGamePadButtonThe button
Returns
- bool
trueif the specified button is pressed; otherwise,false.
IsButtonReleased(IGamePadDevice, GamePadButton)
Determines whether the specified button is released since the previous update.
public static bool IsButtonReleased(this IGamePadDevice gamepad, GamePadButton button)
Parameters
gamepadIGamePadDeviceThe gamepad
buttonGamePadButtonThe button
Returns
- bool
trueif the specified button is released; otherwise,false.
SetVibration(IGamePadDevice, float)
Sets all the gamepad vibration motors to the same amount
public static void SetVibration(this IGamePadDevice gamepad, float amount)
Parameters
gamepadIGamePadDeviceThe gamepad
amountfloatThe amount of vibration
SetVibration(IGamePadDevice, float, float)
Sets the gamepad's large and small motors to the given amounts
public static void SetVibration(this IGamePadDevice gamepad, float largeMotors, float smallMotors)
Parameters
gamepadIGamePadDeviceThe gamepad
largeMotorsfloatThe amount of vibration for the large motors
smallMotorsfloatThe amount of vibration for the small motors