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 - pixi/loaders/ImageLoader.js, line 5
Members
-
<readonly> frames :Array
-
if the image is loaded with loadFramedSpriteSheet frames will contain the sprite sheet frames
- Source - pixi/loaders/ImageLoader.js, line 26
-
texture :PIXI.Texture
-
The texture being loaded
- Source - pixi/loaders/ImageLoader.js, line 18
Methods
-
load()
-
Loads image or takes it from cache
- Source - pixi/loaders/ImageLoader.js, line 42
-
loadFramedSpriteSheet(frameWidth, frameHeight, textureName)
-
Loads image and split it to uniform sized frames
Parameters:
Name Type Description frameWidthNumber width of each frame
frameHeightNumber height of each frame
textureNameString if given, the frames will be cached in <textureName>-<ord> format
- Source - pixi/loaders/ImageLoader.js, line 70
