PointerEvent
Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.
interface PointerEvent { pointerId: number; pointerDown: boolean; isPrimary: boolean;}
A collection of information relating to pointer events.
Variables
Section titled “Variables”Variable | Type | Description |
---|---|---|
pointerId | number | The Id number of the pointer, starting at 0. |
pointerDown | boolean | Whether or not the pointer is currently down. |
isPrimary | boolean | Whether or not the pointer is the primary pointer aka the first to touch down. |
Example
Section titled “Example”symbol.nodes.Plane.on("pointerup", (e) => { // Runs when pointerup occurs on the Plane node // The argument e contains useful info about this event:
// Stores the ID of the pointer as a number, starting at 0 var pointerNumber = e.pointerId;
// Stores whether or not the pointer is currently down, as a boolean var isPointerDown = e.pointerDown;
// Stores whether or not the pointer is the primary pointer (the first to touch down), as a boolean var isPointerPrimary = e.isPrimary;});