Table of Contents

Class GamePadDeviceExtensions

Namespace
Stride.Input
Assembly
Stride.Input.dll

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 IGamePadDevice

The gamepad

button GamePadButton

The 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 IGamePadDevice

The gamepad

button GamePadButton

The 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 IGamePadDevice

The gamepad

button GamePadButton

The 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 IGamePadDevice

The gamepad

amount float

The 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 IGamePadDevice

The gamepad

largeMotors float

The amount of vibration for the large motors

smallMotors float

The amount of vibration for the small motors