# CreditDisplay

#### new Cesium.CreditDisplay(container, delimiter, viewport)
engine/Source/Scene/CreditDisplay.js 301

The credit display is responsible for displaying credits on screen.

Name | Type | Default | Description
--- | --- | --- | ---
`container` | HTMLElement |  | The HTML element where credits will be displayed
`delimiter` | string | `'•'` | optional The string to separate text credits
`viewport` | HTMLElement | `document.body` | optional The HTML element that will contain the credits popup

##### Examples:

    // Add a credit with a tooltip, image and link to display onscreen
    const credit = new Cesium.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 Cesium.Credit('<a href="https://cesium.com/" target="_blank">Cesium</a>');
    viewer.creditDisplay.addStaticCredit(credit);

### Members

#### static Cesium.CreditDisplay.cesiumCredit : Credit
engine/Source/Scene/CreditDisplay.js 641

Gets or sets the Cesium logo credit.

#### container : HTMLElement
engine/Source/Scene/CreditDisplay.js 389

The HTML element where credits will be displayed.

### Methods

#### addCreditToNextFrame(credit)
engine/Source/Scene/CreditDisplay.js 421

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.

Name | Type | Description
--- | --- | ---
`credit` | Credit | The credit to display in the next frame.

##### See:

- CreditDisplay.addStaticCredit

#### addStaticCredit(credit)
engine/Source/Scene/CreditDisplay.js 461

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

Name | Type | Description
--- | --- | ---
`credit` | Credit | The credit to added

##### Examples:

    // Add a credit with a tooltip, image and link to display onscreen
    const credit = new Cesium.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 Cesium.Credit('<a href="https://cesium.com/" target="_blank">Cesium</a>');
    viewer.creditDisplay.addStaticCredit(credit);

#### beginFrame()
engine/Source/Scene/CreditDisplay.js 517

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

#### destroy()
engine/Source/Scene/CreditDisplay.js 582

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.
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.

##### Throws:

- DeveloperError : This object was destroyed, i.e., destroy() was called.

#### endFrame()
engine/Source/Scene/CreditDisplay.js 555

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

#### isDestroyed() → boolean
engine/Source/Scene/CreditDisplay.js 599

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

##### Returns:

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

#### removeStaticCredit(credit)
engine/Source/Scene/CreditDisplay.js 477

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

Name | Type | Description
--- | --- | ---
`credit` | Credit | The credit to be removed.

#### update()
engine/Source/Scene/CreditDisplay.js 508

Updates the credit display before a new frame is rendered.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.