new ImageLoader(manager)
A loader for loading an Image.
Parameters:
Name | Type | Description |
---|---|---|
manager |
zen3d.LoadingManager | — The loadingManager for the loader to use. Default is zen3d.DefaultLoadingManager. |
- Source:
Methods
load(url, onLoad=opt, onProgress=opt, onError=opt)
Load the URL and pass the response to the onLoad function.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
url |
string | — the path or URL to the file. This can also be a Data URI. | |
onLoad= |
function |
<optional> |
— Will be called when loading completes. The argument will be the loaded image. |
onProgress= |
function |
<optional> |
— Will be called while load progresses. todo. |
onError= |
function |
<optional> |
— Will be called if an error occurs. |
- Source:
setCrossOrigin(value) → {zen3d.ImageLoader}
If set, assigns the crossOrigin attribute of the image to the value of crossOrigin, prior to starting the load.
Default is "anonymous".
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
- Source:
Returns:
- Type
- zen3d.ImageLoader
setPath(value) → {zen3d.ImageLoader}
Set the base path or URL from which to load files.
This can be useful if you are loading many images from the same directory.
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
- Source:
Returns:
- Type
- zen3d.ImageLoader