Constructor
new LoadingManager(onLoadopt, onProgressopt, onErroropt)
Creates a new LoadingManager.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
onLoad | function | <optional> | — this function will be called when all loaders are done. |
onProgress | function | <optional> | — this function will be called when an item is complete. |
onError | function | <optional> | — this function will be called a loader encounters errors. |
Members
onStart :function
This function will be called when loading starts. The arguments are: url — The url of the item just loaded. itemsLoaded — the number of items already loaded so far. itemsTotal — the total amount of items to be loaded.
Type:
- function
- Default Value
- undefined
Methods
itemEnd(url)
This should be called by any loader using the manager when the loader ended loading an url.
Parameters:
Name | Type | Description |
---|---|---|
url | String | the loaded url. |
itemError(url)
This should be called by any loader using the manager when the loader errors loading an url.
Parameters:
Name | Type | Description |
---|---|---|
url | String | the loaded url. |
itemStart(url)
This should be called by any loader using the manager when the loader starts loading an url.
Parameters:
Name | Type | Description |
---|---|---|
url | String | the url to load. |
resolveURL(url)
Given a URL, uses the URL modifier callback (if any) and returns a resolved URL. If no URL modifier is set, returns the original URL.
Parameters:
Name | Type | Description |
---|---|---|
url | String | the url to load. |
setURLModifier(callback)
If provided, the callback will be passed each resource URL before a request is sent. The callback may return the original URL, or a new URL to override loading behavior. This behavior can be used to load assets from .ZIP files, drag-and-drop APIs, and Data URIs.
Parameters:
Name | Type | Description |
---|---|---|
callback | function | URL modifier callback. Called with url argument, and must return resolvedURL. |