pixi.loaders.ImageLoader

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

Constructor

new(url : String, ?crossorigin : Bool)
parameters
url {String} The url of the image
[crossorigin] {Bool} Whether requests should be treated as crossorigin
The image loader class is responsible for loading images file formats ('jpeg', 'jpg', 'png' and 'gif') Once the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId() When loaded this class will dispatch a 'loaded' event

Instance Variables hide inherited show inherited

frames : Array<pixi.textures.Texture>

if the image is loaded with loadFramedSpriteSheet frames will contain the sprite sheet frames
The texture being loaded

Instance Methods hide inherited show inherited

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

Loads image or takes it from cache

loadFramedSpriteSheet(frameWidth : Float, frameHeight : Float, ?textureName : String) : Void

parameters
frameWidth {Float} width of each frame
frameHeight {Float} height of each frame
textureName {String} if given, the frames will be cached in - format
Loads image and split it to uniform sized frames

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