Skip to main content
Version: Phaser v3.88.2

AsepriteFile

A single JSON based Texture Atlas File suitable for loading by the Loader.

These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly.

For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas.

https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm

Constructor

new AsepriteFile(loader, key, [textureURL], [atlasURL], [textureXhrSettings], [atlasXhrSettings])

Parameters

nametypeoptionaldescription
loaderPhaser.Loader.LoaderPluginNoA reference to the Loader that is responsible for this file.
keystring | Phaser.Types.Loader.FileTypes.AsepriteFileConfigNoThe key to use for this file, or a file configuration object.
textureURLstring | Array.<string>YesThe absolute or relative URL to load the texture image file from. If undefined or null it will be set to <key>.png, i.e. if key was "alien" then the URL will be "alien.png".
atlasURLobject | stringYesThe absolute or relative URL to load the texture atlas json data file from. If undefined or null it will be set to <key>.json, i.e. if key was "alien" then the URL will be "alien.json". Or, a well formed JSON object.
textureXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesAn XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.
atlasXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesAn XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings.

Scope: static

Extends

Phaser.Loader.MultiFile

Source: src/loader/filetypes/AsepriteFile.js#L15
Since: 3.50.0

Inherited Methods

From Phaser.Loader.MultiFile:


Public Methods

addToCache

<instance> addToCache()

Description:

Adds this file to its target cache upon successful loading and processing.

Source: src/loader/filetypes/AsepriteFile.js#L87
Since: 3.7.0


Inherited Members

From Phaser.Loader.MultiFile: