Class XRViewport
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The WebXR Device API's XRViewport interface provides properties used to describe the size and position of the current viewport within the XRWebGLLayer being used to render the 3D scene.
[Value("XRViewport")]
public class XRViewport
- Inheritance
-
XRViewport
- Inherited Members
Remarks
Constructors
XRViewport()
public XRViewport()
Properties
Height
The read-only XRViewport propertyheight specifies the height, in pixels, of the viewport
onto the drawing surface within which the WebXR view is to be rendered. Along
with Width and the origin point given by
X and Y, this defines the
area within which rendered content will be drawn.
[Value("height")]
public long Height { get; }
Property Value
- long
The viewport's height in pixels.
Remarks
Width
The read-only XRViewport propertywidth specifies the width of the viewport, in pixels,
onto the drawing surface the 3D scene is to be rendered into. This is defined
using this property along with the viewport's Height
and its origin given by its properties X and
Y.
[Value("width")]
public long Width { get; }
Property Value
- long
The viewport's width in pixels.
Remarks
X
The read-only XRViewport interface'sx 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 XRViewPort.Width
and Height properties.
[Value("x")]
public long X { get; }
Property Value
- long
The offset from the left edge of the rendering surface to the left edge of the
viewport, in pixels.
Remarks
Y
The read-only XRViewport interface'sy property indicates the offset from the bottom edge of
the destination surface (typically a XRWebGLLayer) to the bottom edge of
the viewport within the surface into which WebXR content is to be rendered. The
viewport's X property identifies the x
component of the origin, and its is given by the XRViewPort.Width
and Height properties.
[Value("y")]
public long Y { get; }
Property Value
- long
The offset from the bottom edge of the rendering surface to the bottom edge of the
viewport, in pixels.NOTE
Although other web APIs typically consider they
axis to begin at the top and grow larger progressing downward, WebGL reverses this,
withygrowing larger as it goes upward on the screen.