GamePadDeviceExtensions Class
Namespace: Stride.InputAssembly: Stride.Input.dll
Provides easier ways to set vibration levels on a controller, rather than setting 4 motors
public static class GamePadDeviceExtensions
Name | Description | |
---|---|---|
Methods | ||
IsButtonDown(IGamePadDevice, GamePadButton) | Determines whether the specified button is being pressed down |
|
IsButtonPressed(IGamePadDevice, GamePadButton) | Determines whether the specified button is pressed since the previous update. |
|
IsButtonReleased(IGamePadDevice, GamePadButton) | Determines whether the specified button is released since the previous update. |
|
SetVibration(IGamePadDevice, Single) | Sets all the gamepad vibration motors to the same amount |
|
SetVibration(IGamePadDevice, Single, Single) | Sets the gamepad's large and small motors to the given amounts |
Methods
IsButtonDown(IGamePadDevice, GamePadButton)
Determines whether the specified button is being pressed down
public static bool IsButtonDown(this IGamePadDevice gamepad, GamePadButton button)
Parameters
Type | Name | Description |
---|---|---|
IGamePadDevice | gamepad | The gamepad |
GamePadButton | button | The button |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsButtonPressed(IGamePadDevice, GamePadButton)
Determines whether the specified button is pressed since the previous update.
public static bool IsButtonPressed(this IGamePadDevice gamepad, GamePadButton button)
Parameters
Type | Name | Description |
---|---|---|
IGamePadDevice | gamepad | The gamepad |
GamePadButton | button | The button |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsButtonReleased(IGamePadDevice, GamePadButton)
Determines whether the specified button is released since the previous update.
public static bool IsButtonReleased(this IGamePadDevice gamepad, GamePadButton button)
Parameters
Type | Name | Description |
---|---|---|
IGamePadDevice | gamepad | The gamepad |
GamePadButton | button | The button |
Returns
Type | Description |
---|---|
System.Boolean |
|
SetVibration(IGamePadDevice, Single)
Sets all the gamepad vibration motors to the same amount
public static void SetVibration(this IGamePadDevice gamepad, float amount)
Parameters
Type | Name | Description |
---|---|---|
IGamePadDevice | gamepad | The gamepad |
System.Single | amount | The amount of vibration |
SetVibration(IGamePadDevice, Single, Single)
Sets the gamepad's large and small motors to the given amounts
public static void SetVibration(this IGamePadDevice gamepad, float largeMotors, float smallMotors)
Parameters
Type | Name | Description |
---|---|---|
IGamePadDevice | gamepad | The gamepad |
System.Single | largeMotors | The amount of vibration for the large motors |
System.Single | smallMotors | The amount of vibration for the small motors |