new ImageLoader(url, 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.fromFrame() and PIXI.Sprite.fromFrame() When loaded this class will dispatch a 'loaded' event
Parameters
Name | Type | Description |
---|---|---|
url |
String | The url of the image |
crossorigin |
Boolean | Whether requests should be treated as crossorigin |
- Source code: pixi/loaders/ImageLoader.js, line 5
Public Properties
-
[readonly] frames : Array
-
if the image is loaded with loadFramedSpriteSheet frames will contain the sprite sheet frames
- Source code: pixi/loaders/ImageLoader.js, line 26
-
texture : PIXI.Texture
-
The texture being loaded
- Source code: pixi/loaders/ImageLoader.js, line 18
Public Methods
-
load()
-
Loads image or takes it from cache
- Source code: pixi/loaders/ImageLoader.js, line 42
-
loadFramedSpriteSheet(frameWidth, frameHeight, textureName)
-
Loads image and split it to uniform sized frames
Parameters
Name Type Description frameWidth
Number width of each frame
frameHeight
Number height of each frame
textureName
String if given, the frames will be cached in <textureName>-<ord> format
- Source code: pixi/loaders/ImageLoader.js, line 70