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