Skip to content

PointerPresentEvent

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 PointerPresentEvent extends PointerEvent {
screenPosition: number[];
localPosition: number[];
}

An extended collection of information relating to pointer events, including positional data.

VariableTypeDescription
screenPositionnumber[]An array returning the screen position of the pointer event.
localPositionnumber[]An array returning the local position of the pointer event.
symbol.nodes.Plane.on("pointerdown", (e) => {
// Runs when pointerdown occurs on the Plane node
// The argument e contains useful info about this event:
// Stores the screenPosition of the pointer [x,y]
var pointerScreenPosition = e.screenPosition;
// Stores the localPosition of the pointer [x,y,z], in the plane's local coordinate system
var pointerLocalPosition = e.localPosition;
// 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;
});