Skip to content

KBE3D / KBCore / Cesium / CreditDisplay

类: CreditDisplay

The credit display is responsible for displaying credits on screen.

Examples

ts
// 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);
ts
// 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);

参数

The HTML element where credits will be displayed

参数

The string to separate text credits

参数

The HTML element that will contain the credits popup

属性

cesiumCredit

static cesiumCredit: Credit

Gets or sets the Cesium logo credit.


container

container: HTMLElement

The HTML element where credits will be displayed.

方法

addCreditToNextFrame()

addCreditToNextFrame(credit: Credit): void

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.

参数

credit

Credit

The credit to display in the next frame.

返回

void


addStaticCredit()

addStaticCredit(credit: Credit): void

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

参数

credit

Credit

The credit to added

返回

void

Examples

ts
// 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);
ts
// 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);

removeStaticCredit()

removeStaticCredit(credit: Credit): void

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

参数

credit

Credit

The credit to be removed.

返回

void


update()

update(): void

Updates the credit display before a new frame is rendered.

返回

void


beginFrame()

beginFrame(): void

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

返回

void


endFrame()

endFrame(): void

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

返回

void


destroy()

destroy(): void

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. <br /><br /> Once an object is destroyed, it should not be used; calling any function other than <code>isDestroyed</code> will result in a DeveloperError exception. Therefore, assign the return value (<code>undefined</code>) to the object as done in the example.

返回

void


isDestroyed()

isDestroyed(): boolean

Returns true if this object was destroyed; otherwise, false. <br /><br />

返回

boolean

true if this object was destroyed; otherwise, false.

构造函数

构造函数

new CreditDisplay(container: HTMLElement, delimiter?: string, viewport?: HTMLElement): CreditDisplay

参数

container

HTMLElement

delimiter?

string

viewport?

HTMLElement

返回

CreditDisplay

KBE3D @3.0.0 Copyright © 2024-present KBE3D