Class: StaticAsset

StaticAsset(element)

An immutable Asset compatible with WebGlStage and CssStage.

Constructor

new StaticAsset(element)

Parameters:
Name Type Description
element HTMLImageElement | HTMLCanvasElement | ImageBitmap

The underlying pixel source.

Implements:
Throws:

If the pixel source is unsupported.

Methods

destroy()

Destructor.

element() → {*}

Returns the asset's underlying pixel source. The type varies depending on the Stage types the asset is compatible with.

Implements:
Returns:
Type
*

height() → {number}

Returns the asset's intrinsic height in CSS pixels.

Implements:
Returns:
Type
number

isDynamic() → {boolean}

Returns whether the asset is dynamic, i.e., whether the contents of the underlying pixel source may change.

Implements:
Returns:
Type
boolean

timestamp() → {number}

Returns the asset's timestamp, which increases monotonically whenever the contents of the underlying pixel source change.

Implements:
Returns:
Type
number

width() → {number}

Returns the asset's intrinsic width in CSS pixels.

Implements:
Returns:
Type
number