TextureLoader Class

Module: Loaders

TextureLoader can be used to load external textures.

Methods

load

(
  • url
  • onLoad
  • onProgress
  • onError
)

Load texture from URL.

Does the same as creating a new Texture object.

Parameters:

  • url String
  • onLoad Function
  • onProgress Function
  • onError Function

loadJSON

(
  • url
  • onLoad
  • onProgress
  • onError
)

Load texture object from JSON.

Parameters:

  • url String
  • onLoad Function
  • onProgress Function
  • onError Function

parse

(
  • url
  • onLoad
)

Parse a texture object JSON description.

Parameters:

  • url String
  • onLoad Function

setCrossOrigin

(
  • url
)
TextureLoader

Set cross origin path for the loader.

Parameters:

  • url String

    URL.

Returns:

TextureLoader:

Self for chaining.

setFonts

(
  • fonts
)

Set list of fonts to be used by this loader.

Parameters:

  • fonts Array

setImages

(
  • images
)

Set list of images to be used by this loader.

Parameters:

  • images Array

setPath

(
  • path
)
TextureLoader

Set base path for texture loading.

Parameters:

  • path String

    Path

Returns:

TextureLoader:

Self for chaining.

setVideos

(
  • videos
)

Set list of videos to be used by this loader.

Parameters:

  • videos Array