new ViewportQuad(rectangle, material)
A viewport aligned quad.
Name | Type | Description |
---|---|---|
rectangle |
BoundingRectangle |
optional
The BoundingRectangle defining the quad's position within the viewport. |
material |
Material |
optional
The Material defining the surface appearance of the viewport quad. |
Example:
var viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));
viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
Source:
Scene/ViewportQuad.js, line 39
Members
-
material :Material
-
The surface appearance of the viewport quad. This can be one of several built-in
Material
objects or a custom material, scripted with Fabric.The default material is
Material.ColorType
.Example:
// 1. Change the color of the default material to yellow viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); // 2. Change material to horizontal stripes viewportQuad.material = Cesium.Material.fromType(Material.StripeType);
See:
Source: Scene/ViewportQuad.js, line 86 -
rectangle :BoundingRectangle
-
The BoundingRectangle defining the quad's position within the viewport.
Example:
viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);
Source: Scene/ViewportQuad.js, line 60 -
show :Boolean
-
Determines if the viewport quad primitive will be shown.
-
Default Value:
true
Source: Scene/ViewportQuad.js, line 46
Methods
-
destroy() → undefined
-
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Once an object is destroyed, it should not be used; calling any function other thanisDestroyed
will result in aDeveloperError
exception. Therefore, assign the return value (undefined
) to the object as done in the example.Returns:
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
quad = quad && quad.destroy();
See:
Source: Scene/ViewportQuad.js, line 184 -
-
isDestroyed() → Boolean
-
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other thanisDestroyed
will result in aDeveloperError
exception.Returns:
True if this object was destroyed; otherwise, false.See:
Source: Scene/ViewportQuad.js, line 161 -
update()
-
Commits changes to properties before rendering by updating the object's WebGL resources.
Throws:
-
DeveloperError : this.material must be defined.
-
DeveloperError : this.rectangle must be defined.
Source: Scene/ViewportQuad.js, line 101 -