Base class for implementing loaders.
Events:
load
Dispatched when the image has completed loading
content — loaded image
error
Dispatched when the image can
message — error message
Constructor methods
constructor(showStatus?: boolean): Loader
Parameters
-
showStatus?: boolean optional
Returns
Loader
Properties
public crossOrigin: string
default — null.
If set, assigns the crossOrigin attribute of the image to the value of crossOrigin, prior to starting the load.
public onLoadComplete: () => void
Will be called when load completes.
The default is a function with empty body.
public onLoadProgress: () => void
Will be called while load progresses.
The default is a function with empty body.
public onLoadStart: () => void
Will be called when load starts.
The default is a function with empty body.
public showStatus: boolean
If true, show loading status in the statusDomElement.
public statusDomElement: HTMLElement
This is the recipient of status messages.
Methods
public addStatusElement(): HTMLElement
Returns
HTMLElement
public createMaterial(m: Material, texturePath: string): boolean
Parameters
Returns
boolean
public extractUrlBase(url: string): string
Parameters
Returns
string
public initMaterials(materials: Material[], texturePath: string): Material[]
Parameters
Returns
Material[]
public needsTangents(materials: Material[]): boolean
Parameters
Returns
boolean
public updateProgress(progress: Progress)
Parameters