Class that represents a single multi load
springroll.AssetLoad
manager
manager
springroll.AssetManager
Reference to the manager
addTask
asset
Load a single asset
asset
Object
The asset to load, can either be an object, URL/path, or async function.
applyDefaults
asset
Convert assets into object defaults
asset
The function to convert
The object asset to use
getAssetsContainer
mode
Get an empty assets collection
mode
Int
The mode
getTaskByAsset
asset
Get the Task definition for an asset
asset
Object
The asset to check
The Task class
has
name
[callback]
Checks if the EventDispatcher has a specific listener or any listener for a given event.
If the EventDispatcher has the specified listener.
isFunction
obj
Check if an object is an function type
obj
The object
If it's an function
isString
obj
Check if an object is an String type
obj
The object
If it's an String
off
name
callback
Remove the event listener
Return this EventDispatcher for chaining calls.
on
name
callback
[priority=0]
Add an event listener. The parameters for the listener functions depend on the event.
name
String | Object
The type of event (can be multiple events separated by spaces), or a map of events to handlers
callback
Function | Array*
The callback function when event is fired or an array of callbacks.
[priority=0]
Int
optional
The priority of the event listener. Higher numbers are handled first.
Return this EventDispatcher for chaining calls.
once
name
callback
[priority=0]
Add an event listener but only handle it one time.
name
String | Object
The type of event (can be multiple events separated by spaces), or a map of events to handlers
callback
Function | Array*
The callback function when event is fired or an array of callbacks.
[priority=0]
Int
optional
The priority of the event listener. Higher numbers are handled first.
Return this EventDispatcher for chaining calls.
setup
assets
[options]
Initialize the Load
taskDone
task
[result]
Handler when a task has completed
task
springroll.Task
Reference to original task
[result]
optional
The result of load
trigger
type
arguments
Dispatch an event
type
String
The type of event to trigger
arguments
Additional parameters for the listener functions.
progress
Check how many assets have finished loaded
percentage
Number
The amount loaded from 0 to 1