Skip to content

InputAPI reference

Struct PointerInfo

Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.dll
Guide: Input

A pointer the game can read: the mouse while it is over the window, or a finger or pen on the screen.

C#
public readonly struct PointerInfo : IEquatable<PointerInfo>

Implements

IEquatable<PointerInfo>

Constructors

PointerInfo(DeviceId, long, PointerKind, Vector2, bool)

A pointer the game can read: the mouse while it is over the window, or a finger or pen on the screen.

C#
public PointerInfo(DeviceId Device, long Id, PointerKind Kind, Vector2 Position, bool Down)

Parameters

Device DeviceId

The device it belongs to.

Id long

0 for the mouse, the finger’s id for touches.

Kind PointerKind

Mouse, touch or pen.

Position Vector2

Where it is, in virtual canvas pixels.

Down bool

Whether its primary button is held (a finger or pen is always down while it touches). Also true in the update after a press that started and ended within one frame, so a quick tap is never lost.

Properties

Device

The device it belongs to.

C#
public DeviceId Device { get; init; }

Property Value

DeviceId

Down

Whether its primary button is held (a finger or pen is always down while it touches). Also true in the update after a press that started and ended within one frame, so a quick tap is never lost.

C#
public bool Down { get; init; }

Property Value

bool

Id

0 for the mouse, the finger’s id for touches.

C#
public long Id { get; init; }

Property Value

long

Kind

Mouse, touch or pen.

C#
public PointerKind Kind { get; init; }

Property Value

PointerKind

Position

Where it is, in virtual canvas pixels.

C#
public Vector2 Position { get; init; }

Property Value

Vector2

Methods

Deconstruct(out DeviceId, out long, out PointerKind, out Vector2, out bool)

C#
public void Deconstruct(out DeviceId Device, out long Id, out PointerKind Kind, out Vector2 Position, out bool Down)

Parameters

Device DeviceId

Id long

Kind PointerKind

Position Vector2

Down bool

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(PointerInfo)

C#
public bool Equals(PointerInfo other)

Parameters

other PointerInfo

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(PointerInfo, PointerInfo)

C#
public static bool operator ==(PointerInfo left, PointerInfo right)

Parameters

left PointerInfo

right PointerInfo

Returns

bool

operator !=(PointerInfo, PointerInfo)

C#
public static bool operator !=(PointerInfo left, PointerInfo right)

Parameters

left PointerInfo

right PointerInfo

Returns

bool