Class: DynamicCanvasAsset

DynamicCanvasAsset(element)

Dynamic asset containing an HTML canvas element.

Call DynamicCanvasAsset#changed to notify that the contents of the canvas were modified and derived textures need to be refreshed.

Constructor

new DynamicCanvasAsset(element)

Parameters:
Name Type Description
element Element
Implements:

Methods

changed()

Notifies that the contents of the canvas were modified.

destroy()

Destructor.

Implements:

element() → {*}

Retrieves the element that will be used for rendering.

Implements:
Returns:

Something that the Texture can use to refresh itself. e.g. for CssTexture, this is some value that can be used in CanvasRenderingContext2D.drawImage().

Type
*

height() → {number}

Retrieves the height of the Asset.

Implements:
Returns:
Type
number

timestamp() → {number}

Retrieves a timestamp which identifies the current version of the Asset. This is used to prevent dynamic textures from refreshing when not necessary.

Implements:
Returns:
Type
number

width() → {number}

Retrieves the width of the Asset.

Implements:
Returns:
Type
number