AtlasXMLFile
An XML-based Texture Atlas File that coordinates the loading of both a texture image and its associated XML data file as a single unit. Both files must load successfully before the atlas is registered with the Texture Manager. Once registered, individual frames defined in the XML can be used as textures for Game Objects throughout your game.
These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly.
For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML.
Constructor
new AtlasXMLFile(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.AtlasXMLFileConfig | 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 | string | Yes | The absolute or relative URL to load the texture atlas xml data file from. If undefined or null it will be set to <key>.xml, i.e. if key was "alien" then the URL will be "alien.xml". |
| 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 xml file. Used in replacement of the Loaders default XHR Settings. |
Scope: static
Extends
Source: src/loader/filetypes/AtlasXMLFile.js#L15
Since: 3.7.0
Inherited Methods
From Phaser.Loader.MultiFile:
Public Methods
addToCache
<instance> addToCache()
Description:
Checks whether both the image and XML data files have finished loading, and if so, registers the texture atlas with the Texture Manager. An optional normal map (the third file in the set) is also passed through if present. Sets complete to true once the atlas has been added.
Source: src/loader/filetypes/AtlasXMLFile.js#L87
Since: 3.7.0
Inherited Members
From Phaser.Loader.MultiFile: