new CreditDisplay
The credit display is responsible for displaying credits on screen.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
container |
HTMLElement | The HTML element where credits will be displayed | ||
delimiter |
String |
<optional> |
' • ' | The string to separate text credits |
Example
var CreditDisplay = new CreditDisplay(creditContainer);
Source:
Methods
-
addCredit
-
Adds a credit to the list of current credits to be displayed in the credit container
Parameters:
Name Type Description credit
Credit The credit to display -
addDefaultCredit
-
Adds credits that will persist until they are removed
Parameters:
Name Type Description credit
Credit The credit to added to defaults -
beginFrame
-
Resets the credit display to a beginning of frame state, clearing out current credits.
Parameters:
Name Type Description credit
Credit The credit to display -
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.
Once an object is destroyed, it should not be used; calling any function other thanisDestroyed
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.Returns:
-
endFrame
-
Sets the credit display to the end of frame state, displaying current credits in the credit container
Parameters:
Name Type Description credit
Credit The credit to display -
removeDefaultCredit
-
Removes a default credit
Parameters:
Name Type Description credit
Credit The credit to be removed from defaults -
<static> prototype.isDestroyed
-
Returns true if this object was destroyed; otherwise, false.
Returns:
Booleantrue
if this object was destroyed; otherwise,false
.