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
gamepad
IGamePadDeviceThe gamepad
button
GamePadButtonThe button
Returns
- bool
true
if 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
gamepad
IGamePadDeviceThe gamepad
button
GamePadButtonThe button
Returns
- bool
true
if 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
gamepad
IGamePadDeviceThe gamepad
button
GamePadButtonThe button
Returns
- bool
true
if 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
gamepad
IGamePadDeviceThe gamepad
amount
floatThe 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
gamepad
IGamePadDeviceThe gamepad
largeMotors
floatThe amount of vibration for the large motors
smallMotors
floatThe amount of vibration for the small motors