Skip to main content

Backplate

This is a component created to help situate content in AR space. If you have some text, an alert, or a dialog, but you don't want it to float without any context,

Component Breakdown



Render OrderSets the renderOrder for the visuals of the element.
SizeSets the size of the element. X is width, and Y is height.
InactiveMakes the element impossible to interact with. Think "grayed out".
Play AudioTurns on the built-in audio cues for the element.
Add CallbacksAdds the editor hooks for the event callbacks to the element.
On Value Changed CallbacksA callback for when the element's value changes.
On Interaction Finished CallbacksA callback for when the element interaction and changes are all finished.
Enable Interaction PlaneTurns on an Interaction Plane for the element. An InteractionPlane defines a zone which triggers near field targeting logic for HandInteractors.
Interaction Plane OffsetA translation offset for the interaction plane trigger volume.
Interaction Plane PaddingA padding to extend the interaction plane trigger volume beyond the size parameters of the element.
Targeting VisualA dropdown selection for which targeting visual the interaction plane uses when it is activated. Options are None, Cursor, Ray.

Code Example

import { BackPlate } from 'SpectaclesUIKit.lspkg/Scripts/BackPlate';

/**
* Example script for the BackPlate component.
* It creates a back plate and sets its size and style.
*/

@component
export class ExampleBackPlateScript extends BaseScriptComponent {
onAwake() {
const backPlate = this.sceneObject.createComponent(BackPlate.getTypeName());
backPlate.size = new vec2(15, 20);
backPlate.style = 'dark';
}
}
Was this page helpful?
Yes
No