Loader

ImageLoader

A loader for loading an Image. This is used internally by the CubeTextureLoader and TextureLoader.

Code Example

// instantiate a loader const loader = new v3d.ImageLoader(); // load a image resource loader.load( // resource URL 'mytexture.png', // onLoad callback function(image) { // use the image, e.g. draw part of it on a canvas const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); context.drawImage(image, 100, 100); }, // onProgress callback currently not supported undefined, // onError callback function() { console.error('An error happened.'); } );

Constructor

ImageLoader(manager : LoadingManager)

manager — the loadingManager for the loader to use. Default is v3d.DefaultLoadingManager.

Creates a new ImageLoader.

Properties

See the base Loader class for common properties.

Methods

See the base Loader class for common methods.

.load(url : String, onLoad : Function, onProgress : Function, onError : Function) → HTMLImageElement

Begin loading from url and return the image object that will contain the data.

Source

For more info on how to obtain the source code of this module see this page.