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:
11567
-
*
11568
-
* ```javascript
11569
-
* this.load.unityAtlas({
11570
-
* key: 'mainmenu',
11571
-
* textureURL: 'images/MainMenu.png',
11572
-
* normalMap: 'images/MainMenu-n.png',
11573
-
* atlasURL: 'images/MainMenu.txt'
11574
-
* });
11575
-
* ```
11576
-
*
11577
-
* The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.
11578
-
* Normal maps are a WebGL only feature.
11579
-
*
11580
-
* Note: The ability to load this type of file will only be available if the Unity Atlas File type has been built into Phaser.
11581
-
* It is available in the default build but can be excluded from custom builds.
11582
-
*
11583
-
* @method Phaser.Loader.LoaderPlugin#spine
11584
-
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
11585
-
* @since 3.16.0
11586
-
*
11587
-
* @param {(string|Phaser.Loader.FileTypes.SpineFileConfig|Phaser.Loader.FileTypes.SpineFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
11588
-
* @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".
11589
-
* @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `<key>.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt".
11590
-
* @param {XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings.
11591
-
* @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.
11592
-
*
11593
-
* @return {Phaser.Loader.LoaderPlugin} The Loader instance.
11594
-
FileTypesManager.register('spine', function (key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings)
11595
-
{
11596
-
var multifile;
11597
-
11598
-
// Supports an Object file definition in the key argument
11599
-
// Or an array of objects in the key argument
11600
-
// Or a single entry where all arguments have been defined
11601
-
11602
-
if (Array.isArray(key))
11603
-
{
11604
-
for (var i = 0; i < key.length; i++)
11605
-
{
11606
-
multifile = new SpineFile(this, key[i]);
11607
-
11608
-
this.addFile(multifile.files);
11545
+
this.complete = true;
11609
11546
}
11610
11547
}
11611
-
else
11612
-
{
11613
-
multifile = new SpineFile(this, key, jsonURL, atlasURL, jsonXhrSettings, atlasXhrSettings);
11614
11548
11615
-
this.addFile(multifile.files);
11616
-
}
11617
-
11618
-
return this;
11619
11549
});
11620
-
*/
11621
11550
11622
11551
module.exports = SpineFile;
11623
11552
@@ -11787,6 +11716,8 @@ var SpinePlugin = new Class({
11787
11716
11788
11717
this.skeletonRenderer = new runtime.SkeletonRenderer(gl);
11789
11718
11719
+
this.skeletonRenderer.premultipliedAlpha = true;
11720
+
11790
11721
this.shapes = new runtime.ShapeRenderer(gl);
11791
11722
11792
11723
this.debugRenderer = new runtime.SkeletonDebugRenderer(gl);
@@ -11822,7 +11753,7 @@ var SpinePlugin = new Class({
11822
11753
11823
11754
atlas = new Spine.TextureAtlas(atlasData, function (path)
11824
11755
{
11825
-
var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage());
11756
+
var glTexture = new Spine.webgl.GLTexture(gl, textures.get(path).getSourceImage(), false);
11826
11757
11827
11758
spineTextures.add(key, glTexture);
11828
11759
@@ -12024,7 +11955,9 @@ var ComponentsFlip = __webpack_require__(/*! ../../../../src/gameobjects/compone
12024
11955
var ComponentsScrollFactor = __webpack_require__(/*! ../../../../src/gameobjects/components/ScrollFactor */ "../../../src/gameobjects/components/ScrollFactor.js");
12025
11956
var ComponentsTransform = __webpack_require__(/*! ../../../../src/gameobjects/components/Transform */ "../../../src/gameobjects/components/Transform.js");
12026
11957
var ComponentsVisible = __webpack_require__(/*! ../../../../src/gameobjects/components/Visible */ "../../../src/gameobjects/components/Visible.js");
11958
+
var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js");
12027
11959
var GameObject = __webpack_require__(/*! ../../../../src/gameobjects/GameObject */ "../../../src/gameobjects/GameObject.js");
11960
+
var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js");
12028
11961
var SpineGameObjectRender = __webpack_require__(/*! ./SpineGameObjectRender */ "./gameobject/SpineGameObjectRender.js");
12029
11962
12030
11963
/**
@@ -12097,13 +12030,8 @@ var SpineGameObject = new Class({
12097
12030
12098
12031
var skeleton = data.skeleton;
12099
12032
12100
-
skeleton.setToSetupPose();
12101
-
12102
-
skeleton.updateWorldTransform();
12103
-
12104
12033
skeleton.setSkinByName('default');
12105
-
12106
-
this.skeleton = skeleton;
12034
+
skeleton.setToSetupPose();
12107
12035
12108
12036
// AnimationState
12109
12037
data = this.plugin.createAnimationState(skeleton);
@@ -12148,21 +12076,42 @@ var SpineGameObject = new Class({
12148
12076
this.setAnimation(0, animationName, loop);
12149
12077
}
12150
12078
12079
+
var renderer = this.scene.sys.renderer;
12080
+
12081
+
var height = renderer.height;
12082
+
12083
+
var oldScaleX = this.scaleX;
12084
+
var oldScaleY = this.scaleY;
12085
+
12086
+
skeleton.x = this.x;
12087
+
skeleton.y = height - this.y;
12088
+
skeleton.scaleX = 1;
12089
+
skeleton.scaleY = 1;
12090
+
12091
+
this.skeleton = skeleton;
12092
+
12151
12093
this.root = this.getRootBone();
12094
+
12095
+
if (this.root)
12096
+
{
12097
+
// - 90 degrees to account for the difference in Spine vs. Phaser rotation
0 commit comments