Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. XRLayerEvent
  4. XRLayerEvent()

XRLayerEvent: XRLayerEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

TheXRLayerEvent constructor creates and returns a newXRLayerEvent object. These events relate to a change of state of anXRLayer object.

Syntax

js
new XRLayerEvent(type, options)

Parameters

type

A string with the name of the event.It is case-sensitive and browsers always set it toredraw.

options

An object that,in addition of the properties defined inEvent(), can have the following properties:

layer

TheXRLayer to which the event is to be delivered.

Return value

A newXRLayer object representing an object of thespecified type and configured as described by theeventInitDict parameter.

Examples

Creating a newXRLayerEvent

In this example, a newredraw event is created for anXRQuadLayer.

js
const redrawEvent = new XRLayerEvent("redraw", {  layer: quadLayer,});quadLayer.dispatchEvent();

Specifications

Specification
WebXR Layers API Level 1
# dom-xrlayerevent-xrlayerevent

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp