Search Results for

    Show / Hide Table of Contents

    Class Gamepad

    Represents a single hardware gamepad device. Used by the Input to report raw gamepad input events.

    Inheritance
    System.Object
    Object
    InputDevice
    Gamepad
    Inherited Members
    InputDevice.Name
    Object.__unmanagedPtr
    Object.__internalId
    Object.Finalize()
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public sealed class Gamepad : InputDevice

    Constructors

    Gamepad()

    Initializes a new instance of the Gamepad.

    Declaration
    public Gamepad()

    Properties

    IsAnyButtonDown

    Checks if any gamepad button is currently pressed.

    Declaration
    [Unmanaged]
    public bool IsAnyButtonDown { get; }
    Property Value
    System.Boolean

    ProductID

    Gets the gamepad device type identifier.

    Declaration
    [Unmanaged]
    public Guid ProductID { get; }
    Property Value
    System.Guid

    Methods

    GetAxis(GamepadAxis)

    Gets the gamepad axis value.

    Declaration
    [Unmanaged]
    public float GetAxis(GamepadAxis axis)
    Parameters
    GamepadAxis axis

    Gamepad axis to check

    Returns
    System.Single

    Axis value.

    GetButton(GamepadButton)

    Gets the gamepad button state (true if being pressed during the current frame).

    Declaration
    [Unmanaged]
    public bool GetButton(GamepadButton button)
    Parameters
    GamepadButton button

    Gamepad button to check

    Returns
    System.Boolean

    True if user holds down the button, otherwise false.

    GetButtonDown(GamepadButton)

    Gets the gamepad button down state (true if was pressed during the current frame).

    Declaration
    [Unmanaged]
    public bool GetButtonDown(GamepadButton button)
    Parameters
    GamepadButton button

    Gamepad button to check

    Returns
    System.Boolean

    True if user starts pressing down the button, otherwise false.

    GetButtonUp(GamepadButton)

    Gets the gamepad button up state (true if was released during the current frame).

    Declaration
    [Unmanaged]
    public bool GetButtonUp(GamepadButton button)
    Parameters
    GamepadButton button

    Gamepad button to check

    Returns
    System.Boolean

    True if user releases the button, otherwise false.

    ResetColor()

    Resets the color of the gamepad light to the default. Ignored if controller does not support this.

    Declaration
    [Unmanaged]
    public void ResetColor()

    SetColor(Color)

    Sets the color of the gamepad light. Ignored if controller does not support this.

    Declaration
    [Unmanaged]
    public void SetColor(Color color)
    Parameters
    Color color

    The color.

    SetVibration(GamepadVibrationState)

    Sets the state of the gamepad vibration. Ignored if controller does not support this.

    Declaration
    [Unmanaged]
    public void SetVibration(GamepadVibrationState state)
    Parameters
    GamepadVibrationState state

    The state.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat