Skip to content

Image AFrameAdapter

Import

js
import { AFrameAdapter } from 'monolook/image/aframe'

Constructor

js
const adapter = new AFrameAdapter({
  sceneEl,
  showVideo: true,
  container: document.body
})
OptionTypeRequiredDefault
sceneElHTMLElementYes-
showVideobooleanNotrue
containerHTMLElementNodocument.body

Methods

MethodReturnsDescription
attach(tracker)voidConnects to MonolookImage
detach()voidRemoves listeners
addARContent(targetId, el, options?)voidMaps A-Frame entity to target
removeARContent(targetId)voidRemoves AR content
setupVideoBackground()voidCreates video background
setup()voidConfigures background and camera after tracker.start()
destroy()voidCleanup

Notes

PointValue
A-FrameLoad from CDN before your script
THREEUses window.AFRAME.THREE
CameraUse <a-entity camera> and disable look-controls / wasd-controls