Capítulo 174 de 859

Chapter 174: ImageLoader

Core Idea

A loader for loading images. The class loads images with the HTML Image API.

Please note that ImageLoader has dropped support for progress events in r84. For an ImageLoader that supports progress events, see this thread.

Code Examples

const loader = new THREE.ImageLoader();
const image = await loader.loadAsync( 'image.png' );
  • What it demonstrates: Typical usage of ImageLoader.

Reference Tables

Constructor

Signature
new ImageLoader( manager : LoadingManager )

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) : ImageStarts loading from the given URL and passes the loaded image to the onLoad() callback. The method also returns a new Image object which can directly be used for texture creation. If you do it th…

Key Takeaways

  1. ImageLoader extends: Loader
  2. Key methods: load.

Connects To