Interface: Asset

Asset

Asset loaded by a Source

Properties:
Name Type Description
dynamic boolean

Whether the asset can change, requiring its texture to be refreshed. Dynamic assets should fire Asset#event:change when they change.

Methods

destroy()

Destroys the instance.

element() → {*}

Retrieves the element that will be used for rendering.

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.

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.

Returns:
Type
number

width() → {number}

Retrieves the width of the Asset.

Returns:
Type
number

Events

change

Signals that the asset has changed.