Class ImageLoader

A loader for loading an image. Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object.

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(manager?: LoadingManager): ImageLoader

Parameters

Returns

ImageLoader

Properties

public crossOrigin: string

Methods

public load(url: string, onLoad?: (image: HTMLImageElement) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): HTMLImageElement

Begin loading from url

Parameters

  • url: string
  • onLoad?: (image: HTMLImageElement) => void optional
  • onProgress?: (event: any) => void optional
  • onError?: (event: any) => void optional

Returns

HTMLImageElement

public setCrossOrigin(crossOrigin: string)

Parameters

  • crossOrigin: string