CreditDisplay

external class CreditDisplay(var container: HTMLElement, delimiter: String? = definedExternally, viewport: HTMLElement? = definedExternally)(source)

The credit display is responsible for displaying credits on screen.

// Add a credit with a tooltip, image and link to display onscreen
const credit = new Credit(`<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>`, true);
viewer.creditDisplay.addStaticCredit(credit);
// Add a credit with a plaintext link to display in the lightbox
const credit = new Credit('<a href="https://cesium.com/" target="_blank">Cesium</a>');
viewer.creditDisplay.addStaticCredit(credit);

Parameters

delimiter

The string to separate text credits Default value - '•'

viewport

The HTML element that will contain the credits popup Default value - document.body

See also

Constructors

Link copied to clipboard
constructor(container: HTMLElement, delimiter: String? = definedExternally, viewport: HTMLElement? = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The HTML element where credits will be displayed

Functions

Link copied to clipboard

Adds a Credit that will show on screen or in the lightbox until the next frame. This is mostly for internal use. Use CreditDisplay.addStaticCredit to add a persistent credit to the screen.

Link copied to clipboard
fun addStaticCredit(credit: Credit)

Adds a Credit that will show on screen or in the lightbox until removed with CreditDisplay.removeStaticCredit.

Link copied to clipboard

Resets the credit display to a beginning of frame state, clearing out current credits.

Link copied to clipboard
fun destroy()

Destroys the resources held by this object. Destroying an object allows for deterministic release of resources, instead of relying on the garbage collector to destroy this object.

Link copied to clipboard
fun endFrame()

Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.

Link copied to clipboard

Returns true if this object was destroyed; otherwise, false.

Link copied to clipboard

Removes a static credit shown on screen or in the lightbox.

Link copied to clipboard
fun update()

Updates the credit display before a new frame is rendered.