Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    GamePadDeviceExtensions Class

    Namespace: Stride.Input
    Assembly: Stride.Input.dll

    Provides easier ways to set vibration levels on a controller, rather than setting 4 motors

    System.Object → GamePadDeviceExtensions
    Derived from GamePadDeviceExtensions:

    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

    | Improve this Doc View Source

    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

    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
    Type Name Description
    IGamePadDevice gamepad

    The gamepad

    GamePadButton button

    The button

    Returns
    Type Description
    System.Boolean

    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
    Type Name Description
    IGamePadDevice gamepad

    The gamepad

    GamePadButton button

    The button

    Returns
    Type Description
    System.Boolean

    true if the specified button is released; otherwise, false.


    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


    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation