API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classPointer

@codexo/exojs / input / stable

Unified mouse / touch / pen pointer. Wraps a single browser `PointerEvent.pointerId` and writes its state (position, buttons, pressure, tilt, etc.) into the engine's shared channels buffer so it can be polled by Input bindings or read directly by interaction-aware scene nodes. Coordinates are stored in the application's logical space - `app.width` / `app.height` units (`0..app.width` × `0..app.height`), matching node positions, the 2-argument View.screenToWorld, and the active camera. The CSS-pixel event coordinates are mapped through the canvas's display rect, so the value is independent of Application.pixelRatio, of the render resolution, and of however the canvas is scaled for display: a click at its right edge always reads `app.width`, whichever sizing policy is in play. A point outside the canvas maps outside `0..app.width` accordingly. The channel writes are normalized to 0..1 (position, size, twist, tilt) for backend-agnostic sampling. Pointers are owned by the InputSystem, which assigns them a slot index in 0..15 (see maxPointers) and exposes their per-slot channel offsets via the Pointer class namespace constants.

33
props
7
methods
0
events
Import
import { Pointer } from '@codexo/exojs'

Unified mouse / touch / pen pointer. Wraps a single browser `PointerEvent.pointerId` and writes its state (position, buttons, pressure, tilt, etc.) into the engine's shared channels buffer so it can be polled by Input bindings or read directly by interaction-aware scene nodes.

Coordinates are stored in the application's logical space - `app.width` / `app.height` units (`0..app.width` × `0..app.height`), matching node positions, the 2-argument View.screenToWorld, and the active camera. The CSS-pixel event coordinates are mapped through the canvas's display rect, so the value is independent of Application.pixelRatio, of the render resolution, and of however the canvas is scaled for display: a click at its right edge always reads `app.width`, whichever sizing policy is in play. A point outside the canvas maps outside `0..app.width` accordingly. The channel writes are normalized to 0..1 (position, size, twist, tilt) for backend-agnostic sampling.

Pointers are owned by the InputSystem, which assigns them a slot index in 0..15 (see maxPointers) and exposes their per-slot channel offsets via the Pointer class namespace constants.

Constructors1
Methods7
destroy(): void
Returns this release's own tap/swipe classification data - whether it closed an actual press, and that press's accumulated excursion - so the caller (the raw pointerup handler, the only place true global arrival order across pointers is still observable) can fold it directly onto the journal entry it builds for this occurrence, rather than reading it back off internal state that a later phase in the same flush could overwrite.
Properties33
Position the platform cancelled this pointer at. (-1, -1) until it has been cancelled at least once.
id: number
Relative motion the host reported for this frame, in design pixels. Normally the same journey as delta, summed over the individual platform events instead of measured between two frame boundaries. The two part company while the pointer is locked (InputSystem.lockPointer): a locked pointer has no position on screen, so position and delta stand still and this is the only thing that still moves. It is what a first-person camera or an infinite drag reads. Zero on a host that reports no relative motion.
Position of the most recent move. Several platform moves in one frame collapse into this, their last one - the coordinates the frame's moved phase is dispatched at. (-1, -1) until the pointer has moved at least once.
Current position in design pixels - always the pointer's latest, live position, never rewound to an earlier phase. A signal handler that needs the coordinates a SPECIFIC phase happened at (press, move, release, context menu) receives them as explicit arguments rather than reading this property, and InteractionEvent.x/InteractionEvent.y are the corresponding immutable per-phase snapshot at the interaction layer - this is a deliberate choice over a temporary rewind-and-restore, which could leave a handler reading a DIFFERENT phase's position if it runs any code after the dispatch that called it returns.
Position of the most recent press. Retains its value after release so tap/drag logic can still read it.
Position at the previous frame boundary. Together with position it spans delta: position - previousPosition === delta on any frame read outside a phase dispatch.
Position of the most recent release. (-1, -1) until the pointer has been released at least once.
type: string
buttons: number
cancelled: boolean
true when the platform cancelled this pointer during this frame (system gesture, focus loss, ...).
down: boolean
true while at least one button is held. Reflects the live button state, not a frame phase.
entered: boolean
true when the pointer entered the canvas during this frame.
exited: boolean
true when the pointer left the canvas during this frame.
height: number
isPrimary: boolean
maxDistanceFromPress: number
Largest distance the pointer reached from pressPosition during the current press, in design pixels. Accumulated from every platform move, so a pointer that travels far and returns to its press position does *not* read as a tap. Resets on the next press.
moved: boolean
true when the pointer moved during this frame. Several platform moves collapse into one.
pressed: boolean
true when the pointer was pressed during this frame. A press and release that both land between two frames set pressed *and* released on the same frame - the phases are not lost.
pressure: number
released: boolean
true when the pointer was released during this frame.
rotation: number
slotIndex: number
tiltX: number
tiltY: number
twist: number
width: number
x: number
y: number
Constants61
Source