Skip to main content

PlayCanvas Events

This section describes the events fired by 8th Wall in a PlayCanvas environment.

You can listen for these events in your web application.

Events Emitted

Event EmittedDescription
xr:camerastatuschangeThis event is emitted when the status of the camera changes. See onCameraStatusChange from XR8.addCameraPipelineModule() for more information on the possible status.
xr:realityerrorThis event is emitted when an error has occured when initializing 8th Wall Web. This is the recommended time at which any error messages should be displayed. The XR8.XrDevice() API can help with determining what type of error messaging should be displayed.
xr:realityreadyThis event is emitted when 8th Wall Web has initialized and at least one frame has been successfully processed. This is the recommended time at which any loading elements should be hidden.
xr:screenshoterrorThis event is emitted in response to the screenshotrequest resulting in an error.
xr:screenshotreadyThis event is emitted in response to the screenshotrequest event being being completed successfully. The JPEG compressed image of the AFrame canvas will be provided.

XR8.XrController Events Emitted

When XR8.XrController.pipelineModule() is added by passing it in extraModules to XR8.PlayCanvas.run() these events are emitted:

Event EmittedDescription
xr:imageloadingThis event is emitted when detection image loading begins.
xr:imagescanningThis event is emitted when all detection images have been loaded and scanning has begun.
xr:imagefoundThis event is emitted when an image target is first found.
xr:imageupdatedThis event is emitted when an image target changes position, rotation or scale.
xr:imagelostThis event is emitted when an image target is no longer being tracked.
xr:meshfoundThis event is emitted when a mesh is first found either after start or after a recenter().
xr:meshupdatedThis event is emitted when the first mesh found changes position or rotation.
xr:meshlostThis event is emitted when recenter() is called.
xr:projectwayspotscanningThis event is emitted when all Project Wayspots have been loaded for scanning.
xr:projectwayspotfoundThis event is emitted when a Project Wayspot is first found.
xr:projectwayspotupdatedThis event is emitted when a Project Wayspot changes position or rotation.
xr:projectwayspotlostThis event is emitted when a Project Wayspot is no longer being tracked.

XR8.LayersController Events Emitted

When XR8.LayersController.pipelineModule() is added by passing it in extraModules to XR8.PlayCanvas.run() these events are emitted:

Event EmittedDescription
xr:layerloadingFires when loading begins for additional layer segmentation resources.
xr:layerscanningFires when all layer segmentation resources have been loaded and scanning has begun. One event is dispatched per layer being scanned.
xr:layerfoundFires when a layer is first found.

XR8.FaceController Events Emitted

When XR8.FaceController.pipelineModule() is added by passing it in extraModules to XR8.PlayCanvas.run() these events are emitted:

Event EmittedDescription
xr:faceloadingFires when loading begins for additional face AR resources.
xr:facescanningFires when all face AR resources have been loaded and scanning has begun.
xr:facefoundFires when a face is first found.
xr:faceupdatedFires when a face is subsequently found.
xr:facelostFires when a face is no longer being tracked.

XR8.HandController Events Emitted

When XR8.HandController.pipelineModule() is added by passing it in extraModules to XR8.PlayCanvas.run() these events are emitted:

Event EmittedDescription
xr:handloadingFires when loading begins for additional hand AR resources.
xr:handscanningFires when all hand AR resources have been loaded and scanning has begun.
xr:handfoundFires when a hand is first found.
xr:handupdatedFires when a hand is subsequently found.
xr:handlostFires when a hand is no longer being tracked.