Skip to content

Commit d5644cf

Browse files
committed
If a config object was passed to MultiAtlasFile it expected the atlas URL to be in the url property, however the docs and file config expected it in atlasURL. You can now use either of these properties to declare the url. Fix phaserjs#4815
1 parent 09a6f55 commit d5644cf

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/loader/filetypes/MultiAtlasFile.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ var MultiAtlasFile = new Class({
4747
var config = key;
4848

4949
key = GetFastValue(config, 'key');
50-
atlasURL = GetFastValue(config, 'url');
50+
51+
if (GetFastValue(config, 'url', false))
52+
{
53+
atlasURL = GetFastValue(config, 'url');
54+
}
55+
else
56+
{
57+
atlasURL = GetFastValue(config, 'atlasURL');
58+
}
59+
5160
atlasXhrSettings = GetFastValue(config, 'xhrSettings');
5261
path = GetFastValue(config, 'path');
5362
baseURL = GetFastValue(config, 'baseURL');

src/loader/filetypes/typedefs/MultiAtlasFileConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*
44
* @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager.
55
* @property {string} [atlasURL] - The absolute or relative URL to load the multi atlas json file from. Or, a well formed JSON object.
6+
* @property {string} [url] - An alias for 'atlasURL'. If given, it overrides anything set in 'atlasURL'.
67
* @property {string} [atlasExtension='json'] - The default file extension to use for the atlas json if no url is provided.
78
* @property {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas json file.
89
* @property {string} [path] - Optional path to use when loading the textures defined in the atlas data.

0 commit comments

Comments
 (0)