Skip to content

@modoki/engine / index / PointerFrame

Interface: PointerFrame

The pointer/tap/drag snapshot — the single active pointer (mouse or primary touch), in CSS/client pixels. Unlike axes/held it is NOT an OR-merged level: there is one pointer source and it is authoritative, so beginSample leaves it untouched (the source overwrites it wholesale each frame) and only the down-edge (pressed/released) is derived centrally by inputSystem.

x/y are the current position; startX/startY are where the current press began (updated on each pressed); dragX/dragY are the delta from that start (0 while up). A tap is a pressed with a small dragX/dragY at released; a drag is a pressed→hold-with-growing-drag→released. Coordinates are viewport CSS px (raw clientX/clientY) — a game maps them to world space itself (raycast / its own projection); deltas are already screen-space and need no mapping. wheel is the accumulated scroll-notch delta THIS frame (+down / −up, one unit per wheel event), consumed and re-zeroed every frame — for camera zoom etc.

Input

down

down: boolean


dragX

dragX: number


dragY

dragY: number


pressed

pressed: boolean


released

released: boolean


startX

startX: number


startY

startY: number


wheel

wheel: number


x

x: number


y

y: number

Built with Modoki.