Image AFrameAdapter
Import
js
import { AFrameAdapter } from 'monolook/image/aframe'Constructor
js
const adapter = new AFrameAdapter({
sceneEl,
showVideo: true,
container: document.body
})| Option | Type | Required | Default |
|---|---|---|---|
sceneEl | HTMLElement | Yes | - |
showVideo | boolean | No | true |
container | HTMLElement | No | document.body |
Methods
| Method | Returns | Description |
|---|---|---|
attach(tracker) | void | Connects to MonolookImage |
detach() | void | Removes listeners |
addARContent(targetId, el, options?) | void | Maps A-Frame entity to target |
removeARContent(targetId) | void | Removes AR content |
setupVideoBackground() | void | Creates video background |
setup() | void | Configures background and camera after tracker.start() |
destroy() | void | Cleanup |
Notes
| Point | Value |
|---|---|
| A-Frame | Load from CDN before your script |
| THREE | Uses window.AFRAME.THREE |
| Camera | Use <a-entity camera> and disable look-controls / wasd-controls |