Class: StaticImageAsset

StaticImageAsset(element)

new StaticImageAsset(element)

Static asset containing an image.

Parameters:
Name Type Description
element Element

HTML Image element.

Implements:

Methods

destroy()

Destroys the instance.

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