Skip to content

API Variable TouchState

github-actions[bot] edited this page Nov 24, 2026 · 1 revision

Variable: TouchState

const TouchState: DataComponentDef<Record<string, 
  | ScalarType<"i32">
| ScalarType<"f32">>>;

Defined in: src/engine/input/deviceEntities.ts:64

The touchscreen this frame (it appears with the first touch): held/down/up bitmasks (bits 0–9: the finger in that slot; bit 10: the primary touch, the first finger down), count fingers down, each slot's position x0/y0…x9/y9 and the primary's (primaryX, primaryY) in canvas pixels, the primary's movement this frame (primaryDeltaX/Y, +Y down), and pinch, how much the distance between the two lowest-slot fingers grew this frame (pixels). A touch the UI took (ADR 0069) isn't in the bitmasks.

Clone this wiki locally