Class Asset extends MessageDispatcher
This is abstract class for custom assets. For example Asset can be used to load video or other data files.Holds information about external assets.
Methods
addLoader(loader) method
Adds given loader to the list. Loader cannot be added to multiply Assets.
Adds given loader to the list. Loader cannot be added to multiply Assets.
onLoaderRequested(factory) method
Called when AssetManager is about to request loaders for this asset.
Called when AssetManager is about to request loaders for this asset.
onAllLoaded() method
abort() method
Aborts loading of this asset.
Aborts loading of this asset.
ready(data) method
Protected method used to notify AssetManager about completion of loading this asset.
Parameters
void
Protected method used to notify AssetManager about completion of loading this asset.
Parameters
data : Object
Returnsvoid
Inherited Methods
on(name, callback, context) inherited method
Adds listener by given name and callback.
Parameters
MessageBinding
Adds listener by given name and callback.
Parameters
name : string — Message name.
callback : function — Function to be called on message send.
context : * — Object to be used as
Returnscallback : function — Function to be called on message send.
context : * — Object to be used as
this
in callback function. MessageBinding
off(names) inherited method
Removes all bindings by given message name.
Parameters
void
Removes all bindings by given message name.
Parameters
names : string — One or more message name.
Returnsvoid
once(name, callback, context) inherited method
Adds listener by given name and callback. Binding will be automatically removed after first execution.
Parameters
MessageBinding
Adds listener by given name and callback. Binding will be automatically removed after first execution.
Parameters
name : string — Message name.
callback : function — Function to be called on message send.
context : * — Object to be used as
Returnscallback : function — Function to be called on message send.
context : * — Object to be used as
this
in callback function. MessageBinding
post(name, params) inherited method
Posts message with a given params.
Adding
Parameters
void
Posts message with a given params.
Adding
~
character to the begging of the name will bubble message to the top of the tree.Parameters
name : string — The name of a message
params : * — A list of params to send
Returnsparams : * — A list of params to send
void
Properties
Inherited Properties
stage : Stage | null inherited property
Returns the stage Game Object to which this belongs to or null if not added onto stage.
Returns the stage Game Object to which this belongs to or null if not added onto stage.
path : string | null inherited property
Returns string representing a url like path to this object in the display
tree.
Returns string representing a url like path to this object in the display
tree.