Home Reference Source
public class | source

Asset

Asset - base of any asset loader.

Constructor Summary

Public Constructor
public

constructor(owner: AssetSystem, protocol: string, filename: string, options: *)

Constructor.

Member Summary

Public Members
public get

data: *

public set

data: *

public get
public get

options: *

public get
public get

Method Summary

Public Methods
public

Destructor (disposes internal resources).

public

fetchSubAsset(path: string, options: *): Promise

Use this asset as fetch engine and load part of it's content as asset.

public abstract

Load asset.

public

makeFetchEngine(fallbackEngine: *): *: Function

public

Called when asset is loaded and ready to use.

Public Constructors

public constructor(owner: AssetSystem, protocol: string, filename: string, options: *) source

Constructor.

Params:

NameTypeAttributeDescription
owner AssetSystem

Asset owner.

protocol string

Used protocol name.

filename string

File name path.

options *

Options.

Public Members

public get data: * source

public set data: * source

public get filename: string source

public get options: * source

public get owner: AssetSystem source

public get protocol: string source

Public Methods

public dispose() source

Destructor (disposes internal resources).

Example:

asset.dispose();
asset = null;

public fetchSubAsset(path: string, options: *): Promise source

Use this asset as fetch engine and load part of it's content as asset.

Params:

NameTypeAttributeDescription
path string

Asset path.

options *

fetch engine options.

Return:

Promise

Promise that loads subasset.

public abstract load(): Promise source

Load asset.

Return:

Promise

Promise that loads asset.

public makeFetchEngine(fallbackEngine: *): *: Function source

Params:

NameTypeAttributeDescription
fallbackEngine *
  • optional

Return:

*

public onReady() source

Called when asset is loaded and ready to use.