You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Or, if you are using a config object use the `normalMap` property:
487
-
*
488
-
* ```javascript
489
-
* this.load.atlas({
490
-
* key: 'mainmenu',
491
-
* textureURL: 'images/MainMenu.png',
492
-
* normalMap: 'images/MainMenu-n.png',
493
-
* atlasURL: 'images/MainMenu.json'
494
-
* });
495
-
* ```
496
-
*
497
-
* The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.
498
-
* Normal maps are a WebGL only feature.
499
-
*
500
-
* Note: The ability to load this type of file will only be available if the Atlas JSON File type has been built into Phaser.
501
-
* It is available in the default build but can be excluded from custom builds.
482
+
* Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser.
502
483
*
503
484
* @method Phaser.Loader.LoaderPlugin#spine
504
485
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
505
486
* @since 3.19.0
506
487
*
507
-
* @param {(string|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
508
-
* @param {string|string[]} [textureURL] - 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".
509
-
* @param {string} [atlasURL] - 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".
510
-
* @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.
511
-
* @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings.
488
+
* @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
489
+
* @param {string} jsonURL - The absolute or relative URL to load the Spine json 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".
490
+
* @param {string|string[]} atlasURL - The absolute or relative URL to load the Spine atlas file from. If undefined or `null` it will be set to `<key>.atlas`, i.e. if `key` was "alien" then the URL will be "alien.atlas".
491
+
* @param {boolean} [preMultipiedAlpha=false] - Do the texture files include pre-multiplied alpha or not?
492
+
* @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings.
493
+
* @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings.
512
494
*
513
495
* @return {Phaser.Loader.LoaderPlugin} The Loader instance.
514
496
*/
@@ -541,6 +523,22 @@ var SpinePlugin = new Class({
541
523
* The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from
542
524
* skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects
543
525
* do not have a Phaser origin.
526
+
*
527
+
* If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period
528
+
* character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains
529
+
* multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference
530
+
* that.
531
+
*
532
+
* ```javascript
533
+
* let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);
534
+
* ```
535
+
*
536
+
* The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it.
537
+
*
538
+
* The animation name is also optional and can be set later via `SpineGameObject.setAnimation`.
539
+
*
540
+
* Should you wish for more control over the object creation, such as setting a slot attachment or skin
541
+
* name, then use `SpinePlugin.make` instead.
544
542
*
545
543
* @method SpinePlugin#add
546
544
* @since 3.19.0
@@ -569,6 +567,21 @@ var SpinePlugin = new Class({
569
567
* The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from
570
568
* skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects
571
569
* do not have a Phaser origin.
570
+
*
571
+
* If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period
572
+
* character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains
573
+
* multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference
0 commit comments