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. AtlasLoader

new AtlasLoader(url, crossorigin)

The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.

To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.

It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to be batched and drawn together for highly increased rendering speed. Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId()

Parameters
Name Type Description
url String

The url of the JSON file

crossorigin Boolean

Whether requests should be treated as crossorigin

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

Public Methods

load()

Starts loading the JSON file

Source code: pixi/loaders/AtlasLoader.js, line 32