Image Tracking Events

In addition to using the SourceShow Preview Design Time and Mask Objects Beneath Surface parameters, ImageTrackers expose event handlers that you can use to be notified of changes in the anchors or their visibility.

ImageTracker specific Events

Event Description
onAnchorNew Event which is emitted when a new anchor (image target) is created by the tracker.
onAnchorVisible Event which is emitted when an anchor (image target) becomes visible in a camera frame.
onAnchorNotVisible Event which is emitted when an anchor (image target) goes from being visible in the previous camera frame, to being not visible in the current frame.

Other Events

Event Description
onClick Event which is emitted when a mouse button is clicked.
onPointerDown Event which is emitted when the user touches their device (e.g. taps a button) or when a mouse button is clicked.
onPointerUp Event which is emitted when a touch or click has been released.
onPointerEnter Event which is emitted when a pointer (e.g a mouse cursor or touch input) enters the bounding area of a specific element.
onPointerMove Event which is emitted when a pointer (e.g a mouse cursor or touch input) moves within the bounding area of a specific element.
onPointerLeave Event which is emitted when a pointer (e.g a mouse cursor or touch input) exits the bounding area of a specific element.
onIntersectionEnter Event which is emitted when an individual element enters (intersects) with another individual element (e.g. Starting a 3D animation when the camera focuses on a 3D component).
onIntersectionLeave Event which is emitted when an individual element exits (intersects) another individual element (e.g. Pausing a 3D animation when the camera focuses away from a 3D component).

Using events

You can use events to increase engagement by adding interactive elements to your Mattercraft project.

You can use Behavior Actions to add such interactivity.

Next article: Image Tracking best practices

zapcode branded_zapcode i