XRViewport.x

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The read-only XRViewport interface's x property indicates the offset from the left edge of the destination surface (typically a XRWebGLLayer to the left edge of the viewport within the surface into which WebXR content is to be rendered. The viewport's y property identifies the y component of the origin, and its is given by the width and height properties.

Syntax

x = xrViewport.x;

Value

The offset from the left edge of the rendering surface to the left edge of the viewport, in pixels.

Examples

See the main XRViewport page for examples.

Specifications

Specification Status Comment
WebXR Device API
The definition of 'XRViewport.x' in that specification.
Working Draft Initial definition.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
xChrome Full support 79Edge Full support 79Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android Full support 11.2

Legend

Full support
Full support
No support
No support