Create a new AcCmLoadingManager instance
Optional
onLoad: AcCmOnLoadCallbackthis function will be called when all loaders are done.
Optional
onProgress: AcCmOnProgressCallbackthis function will be called when an item is complete.
Optional
onError: AcCmOnErrorCallbackthis function will be called a loader encounters errors.
Optional
onThis function will be called when any item errors.
Optional
onThis function will be called when all loading is completed. By default this is undefined, unless passed in the constructor.
Optional
onThis function will be called when an item is complete.
Optional
onThis function will be called when loading starts.
Register a loader with the given regular expression. Can be used to define what loader should be used in order to load specific files. A typical use case is to overwrite the default loader for textures.
A regular expression.
The loader.
Return this object
Retrieve the registered loader for the given file path.
The file path.
Return the registered loader for the given file path.
Remove the loader for the given regular expression.
A regular expression.
Return this object
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.
URL modifier callback. Called with url argument, and must return resolvedURL.
Return this object
Centralized loading manager that handles and tracks multiple loading operations.
This class manages the loading state across multiple file operations, providing progress tracking, error handling, and URL modification capabilities. A default global instance is created and used by loaders if not supplied manually.
Separate loading managers can be useful when you need independent loading progress tracking (e.g., separate progress bars for different types of resources).
Example