@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
|
@@ -43,6 +43,7 @@ var spine = (() => {
|
|
|
43
43
|
// spine-phaser-v3/src/index.ts
|
|
44
44
|
var src_exports = {};
|
|
45
45
|
__export(src_exports, {
|
|
46
|
+
AABBRectangleBoundsProvider: () => AABBRectangleBoundsProvider,
|
|
46
47
|
Alpha: () => Alpha,
|
|
47
48
|
AlphaMixin: () => AlphaMixin,
|
|
48
49
|
AlphaTimeline: () => AlphaTimeline,
|
|
@@ -14651,6 +14652,17 @@ void main () {
|
|
|
14651
14652
|
super(scene, type);
|
|
14652
14653
|
}
|
|
14653
14654
|
};
|
|
14655
|
+
var AABBRectangleBoundsProvider = class {
|
|
14656
|
+
constructor(x, y, width, height) {
|
|
14657
|
+
this.x = x;
|
|
14658
|
+
this.y = y;
|
|
14659
|
+
this.width = width;
|
|
14660
|
+
this.height = height;
|
|
14661
|
+
}
|
|
14662
|
+
calculateBounds() {
|
|
14663
|
+
return { x: this.x, y: this.y, width: this.width, height: this.height };
|
|
14664
|
+
}
|
|
14665
|
+
};
|
|
14654
14666
|
var SetupPoseBoundsProvider = class {
|
|
14655
14667
|
/**
|
|
14656
14668
|
* @param clipping If true, clipping attachments are used to compute the bounds. False, by default.
|
|
@@ -14763,15 +14775,17 @@ void main () {
|
|
|
14763
14775
|
afterUpdateWorldTransforms = () => {
|
|
14764
14776
|
};
|
|
14765
14777
|
premultipliedAlpha = false;
|
|
14778
|
+
offsetX = 0;
|
|
14779
|
+
offsetY = 0;
|
|
14766
14780
|
updateSize() {
|
|
14767
14781
|
if (!this.skeleton)
|
|
14768
14782
|
return;
|
|
14769
14783
|
let bounds = this.boundsProvider.calculateBounds(this);
|
|
14770
|
-
|
|
14771
|
-
|
|
14772
|
-
|
|
14773
|
-
this.
|
|
14774
|
-
this.
|
|
14784
|
+
this.width = bounds.width;
|
|
14785
|
+
this.height = bounds.height;
|
|
14786
|
+
this.setDisplayOrigin(-bounds.x, -bounds.y);
|
|
14787
|
+
this.offsetX = -bounds.x;
|
|
14788
|
+
this.offsetY = -bounds.y;
|
|
14775
14789
|
}
|
|
14776
14790
|
/** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */
|
|
14777
14791
|
skeletonToPhaserWorldCoordinates(point) {
|
|
@@ -14849,17 +14863,19 @@ void main () {
|
|
|
14849
14863
|
parentMatrix
|
|
14850
14864
|
).calc;
|
|
14851
14865
|
let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty;
|
|
14866
|
+
let offsetX = (src.offsetX - src.displayOriginX) * src.scaleX;
|
|
14867
|
+
let offsetY = (src.offsetY - src.displayOriginY) * src.scaleY;
|
|
14852
14868
|
sceneRenderer.drawSkeleton(
|
|
14853
|
-
|
|
14854
|
-
|
|
14869
|
+
src.skeleton,
|
|
14870
|
+
src.premultipliedAlpha,
|
|
14855
14871
|
-1,
|
|
14856
14872
|
-1,
|
|
14857
14873
|
(vertices, numVertices, stride) => {
|
|
14858
14874
|
for (let i = 0; i < numVertices; i += stride) {
|
|
14859
14875
|
let vx = vertices[i];
|
|
14860
14876
|
let vy = vertices[i + 1];
|
|
14861
|
-
vertices[i] = vx * a + vy * c + tx;
|
|
14862
|
-
vertices[i + 1] = vx * b + vy * d + ty;
|
|
14877
|
+
vertices[i] = vx * a + vy * c + tx + offsetX;
|
|
14878
|
+
vertices[i + 1] = vx * b + vy * d + ty + offsetY;
|
|
14863
14879
|
}
|
|
14864
14880
|
}
|
|
14865
14881
|
);
|