Class: ViewportQuad

ViewportQuad

new ViewportQuad(rectangleopt, materialopt)

A viewport aligned quad.
Parameters:
Name Type Attributes 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.
Source:
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);

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.

Type:
Source:
See:
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(Cesium.Material.StripeType);

rectangle :BoundingRectangle

The BoundingRectangle defining the quad's position within the viewport.
Type:
Source:
Example
viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);

show :Boolean

Determines if the viewport quad primitive will be shown.
Type:
  • Boolean
Default Value:
  • true
Source:

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 than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.
Source:
See:
Throws:
This object was destroyed, i.e., destroy() was called.
Type
DeveloperError
Returns:
Type
undefined
Example
quad = quad && quad.destroy();

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 than isDestroyed will result in a DeveloperError exception.
Source:
See:
Returns:
True if this object was destroyed; otherwise, false.
Type
Boolean

update()

Called when Viewer or CesiumWidget render the scene to get the draw commands needed to render this primitive.

Do not call this function directly. This is documented just to list the exceptions that may be propagated when the scene is rendered:

Source:
Throws: