English中文

CreditDisplay

new Cesium.CreditDisplay(container, delimiter, viewport)

片尾字幕显示负责在屏幕上显示片尾字幕。 The credit display is responsible for displaying credits on screen.
名称 Name 类型 Type 默认值 Default 说明 Description
container HTMLElement 将显示制作人员名单的 HTML 元素 The HTML element where credits will be displayed
delimiter string '•' 可选 optional 分隔文本字幕的字符串 The string to separate text credits
viewport HTMLElement document.body 可选 optional 将包含制作人员名单弹出窗口的 HTML 元素 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

获取或设置Cesium徽标信用。 Gets or sets the Cesium logo credit.
将显示制作人员名单的 HTML 元素。 The HTML element where credits will be displayed.

方法 Methods

addCreditToNextFrame(credit)

添加一个 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
添加一个 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);
将片尾显示重置为帧开始状态,清除当前片尾字幕。 Resets the credit display to a beginning of frame state, clearing out current credits.
销毁该对象所拥有的资源。销毁对象可以确定性地释放资源,而不是依赖垃圾收集器来销毁该对象。 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.
将片尾显示设置为帧结束状态,显示片尾容器中最后一帧的片尾字幕。 Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.

isDestroyed()boolean

如果该对象被销毁则返回 true;否则为假。 Returns true if this object was destroyed; otherwise, false.

返回: Returns:
true 如果该物体被摧毁;否则, if this object was destroyed; otherwise, false.

removeStaticCredit(credit)

删除屏幕或灯箱中显示的静态片尾字幕。 Removes a static credit shown on screen or in the lightbox.
名称 Name 类型 Type 说明 Description
credit Credit 要删除的信用。 The credit to be removed.
在渲染新帧之前更新片尾显示。 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.