Class Gamepad
Represents a single hardware gamepad device. Used by the Input to report raw gamepad input events.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class Gamepad : InputDevice
Constructors
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. |