@esotericsoftware/spine-phaser-v3 4.2.77 → 4.2.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SpineGameObject.d.ts +16 -0
- package/dist/SpineGameObject.js +29 -11
- package/dist/esm/spine-phaser-v3.min.mjs +3 -3
- package/dist/esm/spine-phaser-v3.mjs +25 -9
- package/dist/esm/spine-phaser-v3.mjs.map +2 -2
- package/dist/iife/spine-phaser-v3.js +25 -9
- package/dist/iife/spine-phaser-v3.js.map +2 -2
- package/dist/iife/spine-phaser-v3.min.js +2 -2
- package/package.json +4 -4
|
@@ -14431,6 +14431,17 @@ var BaseSpineGameObject = class extends Phaser.GameObjects.GameObject {
|
|
|
14431
14431
|
super(scene, type);
|
|
14432
14432
|
}
|
|
14433
14433
|
};
|
|
14434
|
+
var AABBRectangleBoundsProvider = class {
|
|
14435
|
+
constructor(x, y, width, height) {
|
|
14436
|
+
this.x = x;
|
|
14437
|
+
this.y = y;
|
|
14438
|
+
this.width = width;
|
|
14439
|
+
this.height = height;
|
|
14440
|
+
}
|
|
14441
|
+
calculateBounds() {
|
|
14442
|
+
return { x: this.x, y: this.y, width: this.width, height: this.height };
|
|
14443
|
+
}
|
|
14444
|
+
};
|
|
14434
14445
|
var SetupPoseBoundsProvider = class {
|
|
14435
14446
|
/**
|
|
14436
14447
|
* @param clipping If true, clipping attachments are used to compute the bounds. False, by default.
|
|
@@ -14543,15 +14554,17 @@ var SpineGameObject = class extends DepthMixin(
|
|
|
14543
14554
|
afterUpdateWorldTransforms = () => {
|
|
14544
14555
|
};
|
|
14545
14556
|
premultipliedAlpha = false;
|
|
14557
|
+
offsetX = 0;
|
|
14558
|
+
offsetY = 0;
|
|
14546
14559
|
updateSize() {
|
|
14547
14560
|
if (!this.skeleton)
|
|
14548
14561
|
return;
|
|
14549
14562
|
let bounds = this.boundsProvider.calculateBounds(this);
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
this.
|
|
14554
|
-
this.
|
|
14563
|
+
this.width = bounds.width;
|
|
14564
|
+
this.height = bounds.height;
|
|
14565
|
+
this.setDisplayOrigin(-bounds.x, -bounds.y);
|
|
14566
|
+
this.offsetX = -bounds.x;
|
|
14567
|
+
this.offsetY = -bounds.y;
|
|
14555
14568
|
}
|
|
14556
14569
|
/** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */
|
|
14557
14570
|
skeletonToPhaserWorldCoordinates(point) {
|
|
@@ -14629,17 +14642,19 @@ var SpineGameObject = class extends DepthMixin(
|
|
|
14629
14642
|
parentMatrix
|
|
14630
14643
|
).calc;
|
|
14631
14644
|
let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty;
|
|
14645
|
+
let offsetX = (src.offsetX - src.displayOriginX) * src.scaleX;
|
|
14646
|
+
let offsetY = (src.offsetY - src.displayOriginY) * src.scaleY;
|
|
14632
14647
|
sceneRenderer.drawSkeleton(
|
|
14633
|
-
|
|
14634
|
-
|
|
14648
|
+
src.skeleton,
|
|
14649
|
+
src.premultipliedAlpha,
|
|
14635
14650
|
-1,
|
|
14636
14651
|
-1,
|
|
14637
14652
|
(vertices, numVertices, stride) => {
|
|
14638
14653
|
for (let i = 0; i < numVertices; i += stride) {
|
|
14639
14654
|
let vx = vertices[i];
|
|
14640
14655
|
let vy = vertices[i + 1];
|
|
14641
|
-
vertices[i] = vx * a + vy * c + tx;
|
|
14642
|
-
vertices[i + 1] = vx * b + vy * d + ty;
|
|
14656
|
+
vertices[i] = vx * a + vy * c + tx + offsetX;
|
|
14657
|
+
vertices[i + 1] = vx * b + vy * d + ty + offsetY;
|
|
14643
14658
|
}
|
|
14644
14659
|
}
|
|
14645
14660
|
);
|
|
@@ -15221,6 +15236,7 @@ var SpineAtlasFile = class extends Phaser2.Loader.MultiFile {
|
|
|
15221
15236
|
window.spine = { SpinePlugin };
|
|
15222
15237
|
window["spine.SpinePlugin"] = SpinePlugin;
|
|
15223
15238
|
export {
|
|
15239
|
+
AABBRectangleBoundsProvider,
|
|
15224
15240
|
Alpha,
|
|
15225
15241
|
AlphaMixin,
|
|
15226
15242
|
AlphaTimeline,
|