Skip to main content

Function: LaserPointer()

LaserPointer(options?: object): OverlayPlugin & LaserPointerController

Laser pointer overlay with glowing trail and cursor suppression.

Controlled via stage events (req:pointer:setState, evt:pointer:stateChanged) or programmatically via the returned controller. Toggle with the P key or Esc.

Parameters​

ParameterTypeDescription
options{ active?: boolean; color?: string; cursorIdleMs?: number; idleTimeoutMs?: number; trailDurationMs?: number; }-
options.active?booleanStart with the pointer active. Defaults to false.
options.color?stringBase laser beam color in RGB hex. Defaults to neon laser ruby ('#ff0055').
options.cursorIdleMs?numberInactivity delay before the cursor is hidden. Defaults to 2000ms.
options.idleTimeoutMs?numberInactivity delay before the pointer canvas sleeps. Defaults to 2000ms.
options.trailDurationMs?numberTrail persistence in milliseconds. Defaults to 160ms.

Returns​

OverlayPlugin & LaserPointerController

Example​

stage.overlay(LaserPointer());