GameControllerDeviceBase Class
Namespace: Stride.Input
Assembly: Stride.Input.dll
Base class for gamepads, contains common functionality for gamepad devices
System.Object →
GameControllerDeviceBase
Derived from GameControllerDeviceBase:
public abstract class GameControllerDeviceBase : IGameControllerDevice, IInputDevice
|
Improve this Doc
View Source
Constructors
protected GameControllerDeviceBase()
|
Improve this Doc
View Source
Fields
protected float[] AxisStates
Field Value
Type |
Description |
System.Single[] |
|
protected bool[] ButtonStates
Field Value
Type |
Description |
System.Boolean[] |
|
protected Direction[] DirectionStates
Field Value
|
Improve this Doc
View Source
Properties
public abstract IReadOnlyList<GameControllerAxisInfo> AxisInfos { get; }
Property Value
public abstract IReadOnlyList<GameControllerButtonInfo> ButtonInfos { get; }
Property Value
public abstract IReadOnlyList<GameControllerDirectionInfo> DirectionInfos { get; }
Property Value
public IReadOnlySet<int> DownButtons { get; }
Property Value
public abstract Guid Id { get; }
Property Value
Type |
Description |
System.Guid |
|
public abstract string Name { get; }
Property Value
Type |
Description |
System.String |
|
public IReadOnlySet<int> PressedButtons { get; }
Property Value
public int Priority { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
public virtual Guid ProductId { get; }
Property Value
Type |
Description |
System.Guid |
|
public IReadOnlySet<int> ReleasedButtons { get; }
Property Value
public abstract IInputSource Source { get; }
Property Value
|
Improve this Doc
View Source
Methods
public virtual float GetAxis(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Type |
Description |
System.Single |
|
public virtual Direction GetDirection(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
protected void HandleAxis(int index, float state)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Single |
state |
|
protected void HandleButton(int index, bool state)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Boolean |
state |
|
protected void HandleDirection(int index, Direction state)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Direction |
state |
|
Creates the correct amount of states based on the amount of object infos that are set
protected void InitializeButtonStates()
Raise gamepad events collected by Handle... functions
public virtual void Update(List<InputEvent> inputEvents)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<InputEvent> |
inputEvents |
|
Extension Methods