Skip to content

Commit 3e93f20

Browse files
committed
New Spine plugin build
1 parent 1e7a368 commit 3e93f20

2 files changed

Lines changed: 43 additions & 11 deletions

File tree

plugins/spine/dist/SpinePlugin.js

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11638,6 +11638,7 @@ module.exports = SpineFile;
1163811638
*/
1163911639

1164011640
var Class = __webpack_require__(/*! ../../../src/utils/Class */ "../../../src/utils/Class.js");
11641+
var GetValue = __webpack_require__(/*! ../../../src/utils/object/GetValue */ "../../../src/utils/object/GetValue.js");
1164111642
var ScenePlugin = __webpack_require__(/*! ../../../src/plugins/ScenePlugin */ "../../../src/plugins/ScenePlugin.js");
1164211643
var SpineFile = __webpack_require__(/*! ./SpineFile */ "./SpineFile.js");
1164311644
var Spine = __webpack_require__(/*! Spine */ "./runtimes/spine-both.js");
@@ -11690,7 +11691,7 @@ var SpinePlugin = new Class({
1169011691
this.debugRenderer;
1169111692
this.debugShader;
1169211693

11693-
console.log('SpinePlugin created', '- WebGL:', this.isWebGL, this.cache, this.spineTextures);
11694+
console.log('SpinePlugin created', '- WebGL:', this.isWebGL);
1169411695

1169511696
if (this.isWebGL)
1169611697
{
@@ -11890,13 +11891,35 @@ var SpinePlugin = new Class({
1189011891

1189111892
createSkeleton: function (key, skeletonJSON)
1189211893
{
11893-
var atlas = this.getAtlas(key);
11894+
var atlasKey = key;
11895+
var jsonKey = key;
11896+
11897+
if (key.indexOf('.'))
11898+
{
11899+
var parts = key.split('.');
11900+
11901+
atlasKey = parts.shift();
11902+
jsonKey = parts.join('.');
11903+
}
11904+
11905+
var atlas = this.getAtlas(atlasKey);
1189411906

1189511907
var atlasLoader = new Spine.AtlasAttachmentLoader(atlas);
1189611908

1189711909
var skeletonJson = new Spine.SkeletonJson(atlasLoader);
1189811910

11899-
var data = (skeletonJSON) ? skeletonJSON : this.json.get(key);
11911+
var data;
11912+
11913+
if (skeletonJSON)
11914+
{
11915+
data = skeletonJSON;
11916+
}
11917+
else
11918+
{
11919+
var json = this.json.get(atlasKey);
11920+
11921+
data = GetValue(json, jsonKey);
11922+
}
1190011923

1190111924
var skeletonData = skeletonJson.readSkeletonData(data);
1190211925

@@ -12074,8 +12097,6 @@ var SpineGameObject = new Class({
1207412097

1207512098
var skeleton = data.skeleton;
1207612099

12077-
skeleton.flipY = (this.scene.sys.game.config.renderType === 1);
12078-
1207912100
skeleton.setToSetupPose();
1208012101

1208112102
skeleton.updateWorldTransform();
@@ -12129,6 +12150,11 @@ var SpineGameObject = new Class({
1212912150

1213012151
this.root = this.getRootBone();
1213112152

12153+
this.skeleton.scaleX = this.scaleX;
12154+
this.skeleton.scaleY = this.scaleY;
12155+
12156+
this.skeleton.updateWorldTransform();
12157+
1213212158
var w = this.skeletonData.width;
1213312159
var h = this.skeletonData.height;
1213412160

@@ -12264,9 +12290,6 @@ var SpineGameObject = new Class({
1226412290
{
1226512291
var skeleton = this.skeleton;
1226612292

12267-
skeleton.flipX = this.flipX;
12268-
skeleton.flipY = this.flipY;
12269-
1227012293
this.state.update((delta / 1000) * this.timeScale);
1227112294

1227212295
this.state.apply(skeleton);
@@ -12497,9 +12520,18 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent
1249712520
var height = renderer.height;
1249812521

1249912522
skeleton.x = calcMatrix.tx;
12500-
skeleton.y = height - calcMatrix.ty;
1250112523
skeleton.scaleX = calcMatrix.scaleX;
12502-
skeleton.scaleY = calcMatrix.scaleY;
12524+
12525+
if (camera.renderToTexture)
12526+
{
12527+
skeleton.y = calcMatrix.ty;
12528+
skeleton.scaleY = calcMatrix.scaleY * -1;
12529+
}
12530+
else
12531+
{
12532+
skeleton.y = height - calcMatrix.ty;
12533+
skeleton.scaleY = calcMatrix.scaleY;
12534+
}
1250312535

1250412536
src.root.rotation = RadToDeg(CounterClockwise(calcMatrix.rotation));
1250512537

plugins/spine/dist/SpinePlugin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)