Skip to content

Pointer

interludesoftware.tick

Interlude.Tick

Pointer Struct

A single active pointing device at a single point in time. Returned by GetPointer(int); the per-frame set is enumerated via GetPointerCount().

The provider always reports the mouse at index 0, with IsPrimarytrue — so on a desktop, mouse-only games look identical to the pre-pointer code. Additional active touches follow at indices 1..N; each carries its own Id (the touch's fingerId) so consumers that care about multi-touch can track a single finger across frames.

The mouse pointer is always present (so a mouse-only game sees GetPointerCount() == 1 every frame, with IsDown reflecting whether the left button is held). Touch pointers only appear while their finger is on the screen.

public struct Pointer

Fields

Pointer.Id Field

Stable per-finger ID for touches; -1 for the mouse pointer.

public int Id;

Field Value

System.Int32

Pointer.IsDown Field

True while the pointer is in contact (mouse left button held; touch in progress).

public bool IsDown;

Field Value

System.Boolean

Pointer.IsPrimary Field

The mouse pointer is always primary. The first active touch is also flagged primary so touch-only consumers have a stable "current" pointer to drive single-pointer UI without branching on input source.

public bool IsPrimary;

Field Value

System.Boolean

Pointer.Position Field

Screen-pixel position with the same Y convention as GetMousePosition() (origin at bottom-left, or top-left if the provider was constructed with flipInputY). Layout-space conversion is the caller's responsibility, identical to how mouse position is handled today.

public Vector2 Position;

Field Value

UnityEngine.Vector2

Pointer.WasPressedThisFrame Field

True on the frame the press began (mouse left-button-down; touch began).

public bool WasPressedThisFrame;

Field Value

System.Boolean

Pointer.WasReleasedThisFrame Field

True on the frame the contact ended (mouse left-button-up; touch ended / cancelled).

public bool WasReleasedThisFrame;

Field Value

System.Boolean