Coaching Overlay
Coaching Overlays allow you onboard users and ensure the best experience.
Absolute Scale Coaching Overlay
The Absolute Scale Coaching Overlay onboards users to absolute scale experiences ensuring that they collect the best possible data to determine scale. We designed the Coaching Overlay to make it easily customizable by developers, enabling you to focus your time on building your WebAR experience.
Use Absolute Scale Coaching Overlay in Your Project:
- Open your Project
- Add the following tag to
head.html
<meta name="8thwall:package" content="@8thwall.coaching-overlay">
Note: For Self-Hosted projects, you would add the following <script>
tag to your page instead:
<script src='https://cdn.8thwall.com/web/coaching-overlay/coaching-overlay.js'></script>
- Optionally, customize the parameters of your
coaching-overlay
component as defined below. For Non-AFrame projects, please refer to the CoachingOverlay.configure() documentation.
A-Frame component parameters (all optional)
Parameter | Type | Default | Description |
---|---|---|---|
animationColor | String | 'white' | Color of the Coaching Overlay animation. This parameter accepts valid CSS color arguments. |
promptColor | String | 'white' | Color of all the Coaching Overlay text. This parameter accepts valid CSS color arguments. |
promptText | String | 'Move device forward and back' | Sets the text string for the animation explainer text that informs users of the motion they need to make to generate scale. |
disablePrompt | Boolean | false | Set to true to hide default Coaching Overlay in order to use Coaching Overlay events for a custom overlay. |
Creating a custom Coaching Overlay for your project
Coaching Overlay can be added as a pipeline module and then hidden (using the disablePrompt
parameter) so that you can easily use the Coaching Overlay events to trigger a custom overlay.
Coaching Overlay events are only fired when scale
is set to absolute
. Events are emitted by the
8th Wall camera run loop and can be listened to from within a pipeline module. These events
include:
coaching-overlay.show
: event is triggered when the Coaching Overlay should be shown.coaching-overlay.hide
: event is triggered when the Coaching Overlay should be hidden.
Example - Coaching Overlay with user specified parameters
A-Frame Example (screenshot above)
<a-scene
coaching-overlay="
animationColor: #E86FFF;
promptText: To generate scale push your phone forward and then pull back;"
xrextras-loading
xrextras-gesture-detector
...
xrweb="scale: absolute;">
Non-AFrame Example (screenshot above)
// Configured here
CoachingOverlay.configure({
animationColor: '#E86FFF',
promptText: 'To generate scale push your phone forward and then pull back',
})
XR8.addCameraPipelineModules([
XR8.GlTextureRenderer.pipelineModule(),
XR8.Threejs.pipelineModule(),
XR8.XrController.pipelineModule(),
XRExtras.FullWindowCanvas.pipelineModule(),
XRExtras.Loading.pipelineModule(),
XRExtras.RuntimeError.pipelineModule(),
LandingPage.pipelineModule(),
// Added here
CoachingOverlay.pipelineModule(),
...
])
AFrame Example - Listening for Coaching Overlay events
this.el.sceneEl.addEventListener('coaching-overlay.show', () => {
// Do something
})
this.el.sceneEl.addEventListener('coaching-overlay.hide', () => {
// Do something
})
Non-AFrame Example - Listening for Coaching Overlay events
const myShow = () => {
console.log('EXAMPLE: COACHING OVERLAY - SHOW')
}
const myHide = () => {
console.log('EXAMPLE: COACHING OVERLAY - HIDE')
}
const myPipelineModule = {
name: 'my-coaching-overlay',
listeners: [
{event: 'coaching-overlay.show', process: myShow},
{event: 'coaching-overlay.hide', process: myHide},
],
}
const onxrloaded = () => {
XR8.addCameraPipelineModule(myPipelineModule)
}
window.XR8 ? onxrloaded() : window.addEventListener('xrloaded', onxrloaded)
VPS Coaching Overlay
The VPS Coaching Overlay onboards users to VPS experiences ensuring that they properly localize at real-world locations. We designed the Coaching Overlay to make it easily customizable by developers, enabling you to focus your time on building your WebAR experience.
Use VPS Coaching Overlay in Your Project:
- Open your Project
- Add the following tag to
head.html
<meta name="8thwall:package" content="@8thwall.coaching-overlay">
Note: For Self-Hosted projects, you would add the following <script>
tag to your page instead:
<script src='https://cdn.8thwall.com/web/coaching-overlay/coaching-overlay.js'></script>
- Optionally, customize the parameters of your
coaching-overlay
component as defined below. For Non-AFrame projects, please refer to the VpsCoachingOverlay.configure() documentation.
A-Frame component parameters (all optional)
Parameter | Type | Default | Description |
---|---|---|---|
wayspot-name | String | The name of the Location which the Coaching Overlay is guiding the user to localize at. If no Location name is specified, it will use the nearest Project Location. If the project does not have any Project Locations, then it will use the nearest Location. | |
hint-image | String | Image displayed to the user to guide them to the real-world location. If no hint-image is specified, it will use the default image for the Location. If the Location does not have a default image, no image will be shown. Accepted media sources include img id or static URL. | |
animation-color | String | '#ffffff' | Color of the Coaching Overlay animation. This parameter accepts valid CSS color arguments. |
animation-duration | Number | 5000 | Total time the hint image is displayed before shrinking (in milliseconds). |
prompt-color | String | '#ffffff' | Color of all the Coaching Overlay text. This parameter accepts valid CSS color arguments. |
prompt-prefix | String | 'Point your camera at' | Sets the text string for advised user action above the name of the Location. |
prompt-suffix | String | 'and move around' | Sets the text string for advised user action below the name of the Location. |
status-text | String | 'Scanning...' | Sets the text string that is displayed below the hint-image when it is in the shrunken state. |
disable-prompt | Boolean | false | Set to true to hide default Coaching Overlay in order to use Coaching Overlay events for a custom overlay. |
Creating a custom Coaching Overlay for your project
Coaching Overlay can be added as a pipeline module and then hidden (using the disablePrompt
parameter) so that you can easily use the Coaching Overlay events to trigger a custom overlay.
VPS Coaching Overlay events are only fired when enableVps
is set to true
. Events are
emitted by the 8th Wall camera run loop and can be listened to from within a pipeline module. These
events include:
vps-coaching-overlay.show
: event is triggered when the Coaching Overlay should be shown.vps-coaching-overlay.hide
: event is triggered when the Coaching Overlay should be hidden.
Example - Coaching Overlay with user specified parameters
A-Frame Example (screenshot above)
<a-scene
vps-coaching-overlay="
prompt-color: #0000FF;
prompt-prefix: Go look for;"
xrextras-loading
xrextras-gesture-detector
...
xrweb="vpsEnabled: true;">