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
| Parameter | Type | Description |
|---|---|---|
options | { active?: boolean; color?: string; cursorIdleMs?: number; idleTimeoutMs?: number; trailDurationMs?: number; } | - |
options.active? | boolean | Start with the pointer active. Defaults to false. |
options.color? | string | Base laser beam color in RGB hex. Defaults to neon laser ruby ('#ff0055'). |
options.cursorIdleMs? | number | Inactivity delay before the cursor is hidden. Defaults to 2000ms. |
options.idleTimeoutMs? | number | Inactivity delay before the pointer canvas sleeps. Defaults to 2000ms. |
options.trailDurationMs? | number | Trail persistence in milliseconds. Defaults to 160ms. |
Returns
OverlayPlugin & LaserPointerController
Example
stage.overlay(LaserPointer());