pixi.loaders.AssetLoader

type
class
extends
pixi.utils.EventTarget
metadata
:native
"PIXI.AssetLoader"

Constructor

new(assetURLs : Array<String>, ?crossorigin : Bool)
parameters
{Array<String>} assetURLs an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported sprite sheet data formats only include 'JSON' at this time. Supported bitmap font data formats include 'xml' and 'fnt'.
[crossorigin] {Bool} Whether requests should be treated as crossorigin
A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromImage() and PIXI.Sprite.fromImage() When all items have been loaded this class will dispatch a 'onLoaded' event As each individual item is loaded this class will dispatch a 'onProgress' event

Instance Variables hide inherited show inherited

assetURLs : Array<String>

The array of asset URLs that are going to be loaded

crossorigin : Bool

Whether the requests should be treated as cross origin

loadCount : Int

loadersByType : Dynamic

Maps file extension to loader types

onComplete : Void -> Void

Fired when all the assets are loaded

onProgress : Dynamic -> Void

Fired when an item finishes loading

Instance Methods hide inherited show inherited

_getDataType(str : String) : String

parameters
str {String} the name of the asset
Given a filename, returns its extension.

addEventListener(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget

dispatchEvent(eventName : String, ?data : Dynamic) : Bool

inherited from pixi.utils.EventTarget

emit(eventName : String, ?data : Dynamic) : Bool

inherited from pixi.utils.EventTarget
parameters
eventName {String} The name of the event.
data {Dynamic}
returns
{Bool} Indication if we've emitted an event.
Emit an event to all registered event listeners.

listeners(eventName : String) : Array<Dynamic>

inherited from pixi.utils.EventTarget
parameters
eventName {String} The events that should be listed.
returns
{Array} An array of listener functions
Return a list of assigned event listeners.

load() : Void

Starts loading the assets sequentially

off(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} The event we want to remove.
callback {Function} The listener that we need to find.
Remove event listeners.

on(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} Name of the event.
callback {Functon} Callback function.
Register a new EventListener for the given event.

once(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} Name of the event.
callback {Function} Callback function.
Add an EventListener that's only called once.

removeAllEventListeners(eventName : String) : Void

inherited from pixi.utils.EventTarget
parameters
eventName {String} The event you want to remove all listeners for.
Remove all listeners or only the listeners for the specified event.

removeEventListener(eventName : String, callback : Dynamic) : Void

inherited from pixi.utils.EventTarget