AsepriteFile
A single Aseprite Animation File suitable for loading by the Loader.
Aseprite is an animated sprite editor and pixel art tool. This file type handles loading both the Aseprite sprite sheet image and its accompanying JSON data file, which contains frame and animation tag information. Once loaded, the texture and animation data are added to the Texture Manager and can be used to create animations via AnimationManager.createFromAseprite.
These are created when you use the Phaser.Loader.LoaderPlugin#aseprite method and are not typically created directly.
For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#aseprite.
Constructor
new AsepriteFile(loader, key, [textureURL], [atlasURL], [textureXhrSettings], [atlasXhrSettings])
Parameters
| name | type | optional | description |
|---|---|---|---|
| loader | Phaser.Loader.LoaderPlugin | No | A reference to the Loader that is responsible for this file. |
| key | string | Phaser.Types.Loader.FileTypes.AsepriteFileConfig | No | The key to use for this file, or a file configuration object. |
| textureURL | string | Array.<string> | Yes | The 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". |
| atlasURL | object | string | Yes | The 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. |
| textureXhrSettings | Phaser.Types.Loader.XHRSettingsObject | Yes | An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. |
| atlasXhrSettings | Phaser.Types.Loader.XHRSettingsObject | Yes | An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. |
Scope: static
Extends
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#L90
Since: 3.7.0
Inherited Members
From Phaser.Loader.MultiFile: