TextureLoader

TextureLoader

A Loader class which helps with loading video and image textures

Constructor

new TextureLoader()

Source:

Members

(static) loader :TextureLoader

Source:

A global reference to the singleton texture loader

Type:

Methods

(static) loadSceneTextures(scene) → {Promise.<void>}

Source:

Load all the textures which are required for a particular Scene

Parameters:
Name Type Description
scene Scene

The Scene to load

Returns:
Type
Promise.<void>

getCache(src)

Source:

Retrieve a texture from the texture cache

Parameters:
Name Type Description
src string

The source URL

(async) load(sources, message) → {Promise.<void>}

Source:

Load an Array of provided source URL paths

Parameters:
Name Type Description
sources Array.<string>

The source URLs to load

message string

The status message to display in the load bar

Returns:

A Promise which resolves once all textures are loaded

Type
Promise.<void>

(async) loadImageTexture(src) → {Promise.<PIXI.Texture>}

Source:

Load an image texture from a provided source url

Parameters:
Name Type Description
src string
Returns:
Type
Promise.<PIXI.Texture>

(async) loadTexture(src) → {Promise.<PIXI.Texture>}

Source:

Load a single texture on-demand from a given source URL path

Parameters:
Name Type Description
src
Returns:
Type
Promise.<PIXI.Texture>

(async) loadVideoTexture(src) → {Promise.<PIXI.Texture>}

Source:

Load a video texture from a provided source url

Parameters:
Name Type Description
src string
Returns:
Type
Promise.<PIXI.Texture>

setCache(src, tex)

Source:

Add an image url to the texture cache

Parameters:
Name Type Description
src string

The source URL

tex PIXI.Texture

The readied texture