PointerDeviceState Class
Namespace: Stride.InputAssembly: Stride.Input.dll
Contains logic to generate pointer events and store the resulting state
public class PointerDeviceState
Name | Description | |
---|---|---|
Constructors | ||
PointerDeviceState(IPointerDevice) | ||
Fields | ||
PointerDatas | ||
PointerInputEvents | ||
SourceDevice | ||
Properties | ||
DownPointers | ||
InverseSurfaceSize | ||
PressedPointers | ||
ReleasedPointers | ||
SurfaceAspectRatio | ||
SurfaceSize | ||
Methods | ||
GetPointerData(Int32) | Retrueves a pointer data structure unqiue to the given pointer ID |
|
ProcessPointerEvent(PointerDeviceState.InputEvent) | Processes a PointerDeviceState.InputEvent, converting it to a PointerEvent. Also calls |
|
SetSurfaceSize(Vector2) | Updates the surface size of the pointing device, updates SurfaceSize, SurfaceAspectRatio, Stride.Input.PointerDeviceState.invSurfaceSize and calls |
|
Update(List<InputEvent>) | Generate input events |
|
UpdatePointerState(PointerEvent, Boolean) | Updates a pointer event with position / type / id set and updates the storted pointer data |
Constructors
PointerDeviceState(IPointerDevice)
public PointerDeviceState(IPointerDevice pointerDevice)
Parameters
Type | Name | Description |
---|---|---|
IPointerDevice | pointerDevice |
Fields
PointerDatas
public readonly List<PointerDeviceState.PointerData> PointerDatas
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<PointerDeviceState.PointerData> |
PointerInputEvents
public readonly List<PointerDeviceState.InputEvent> PointerInputEvents
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<PointerDeviceState.InputEvent> |
SourceDevice
public IPointerDevice SourceDevice
Field Value
Type | Description |
---|---|
IPointerDevice |
Properties
DownPointers
public IReadOnlySet<PointerPoint> DownPointers { get; }
Property Value
Type | Description |
---|---|
IReadOnlySet<PointerPoint> |
InverseSurfaceSize
public Vector2 InverseSurfaceSize { get; }
Property Value
Type | Description |
---|---|
Vector2 |
PressedPointers
public IReadOnlySet<PointerPoint> PressedPointers { get; }
Property Value
Type | Description |
---|---|
IReadOnlySet<PointerPoint> |
ReleasedPointers
public IReadOnlySet<PointerPoint> ReleasedPointers { get; }
Property Value
Type | Description |
---|---|
IReadOnlySet<PointerPoint> |
SurfaceAspectRatio
public float SurfaceAspectRatio { get; }
Property Value
Type | Description |
---|---|
System.Single |
SurfaceSize
public Vector2 SurfaceSize { get; }
Property Value
Type | Description |
---|---|
Vector2 |
Methods
GetPointerData(Int32)
Retrueves a pointer data structure unqiue to the given pointer ID
public PointerDeviceState.PointerData GetPointerData(int pointerId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pointerId |
Returns
Type | Description |
---|---|
PointerDeviceState.PointerData |
ProcessPointerEvent(PointerDeviceState.InputEvent)
Processes a PointerDeviceState.InputEvent, converting it to a PointerEvent. Also calls
public PointerEvent ProcessPointerEvent(PointerDeviceState.InputEvent evt)
Parameters
Type | Name | Description |
---|---|---|
PointerDeviceState.InputEvent | evt |
Returns
Type | Description |
---|---|
PointerEvent |
SetSurfaceSize(Vector2)
Updates the surface size of the pointing device, updates SurfaceSize, SurfaceAspectRatio, Stride.Input.PointerDeviceState.invSurfaceSize and calls
public void SetSurfaceSize(Vector2 newSize)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | newSize | New size of the surface |
Update(List<InputEvent>)
Generate input events
public void Update(List<InputEvent> inputEvents)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<InputEvent> | inputEvents |
UpdatePointerState(PointerEvent, Boolean)
Updates a pointer event with position / type / id set and updates the storted pointer data
public void UpdatePointerState(PointerEvent evt, bool updateDelta = true)
Parameters
Type | Name | Description |
---|---|---|
PointerEvent | evt | |
System.Boolean | updateDelta |