Back to Content

XRViewport: x property

files/en-us/web/api/xrviewport/x/index.md

latest814 B
Original Source

{{APIRef("WebXR Device API")}}{{SecureContext_Header}}

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

Value

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

Examples

See the main {{domxref("XRViewport")}} page for examples.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}