WebXR Device API
The layer property of the XRLayerEvent interface is a reference to the XRLayer which generated the event.
Value
An XRLayer.
Examples
Using the layer property
In this example, the layer property is used to obtain the XRLayer object that sent the event.
myLayer.addEventListener("redraw", (e) => {
if (e.layer instanceof XRQuadLayer) {
// redraw quad layer
}
});
Specifications
Browser compatibility
See also
- XRLayer
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
