Navigation
These archived docs are for Phaser 2.2.2 Phaser 3 docs can be found on newdocs.phaser.io.
Phaser CE docs can be found on the Phaser CE Documentation site.

Constructor

PIXI. AssetLoader

new AssetLoader(assetURLs, 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

Parameters
Name Type Description
assetURLs Array.<String>

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 Boolean

Whether requests should be treated as crossorigin

Source code: pixi/loaders/AssetLoader.js, line 5

Public Properties

assetURLs : Array.<String>

The array of asset URLs that are going to be loaded

Type
  • Array.<String>
Source code: pixi/loaders/AssetLoader.js, line 23

crossorigin : boolean

Whether the requests should be treated as cross origin

Source code: pixi/loaders/AssetLoader.js, line 31

loadersByType : Object

Maps file extension to loader types

Source code: pixi/loaders/AssetLoader.js, line 39

Public Methods

_getDataType(str)

Given a filename, returns its extension.

Parameters
Name Type Description
str String

the name of the asset

Source code: pixi/loaders/AssetLoader.js, line 74

load()

Starts loading the assets sequentially

Source code: pixi/loaders/AssetLoader.js, line 107