@esotericsoftware/spine-canvas 4.2.2 → 4.2.5
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.
|
@@ -52,7 +52,6 @@ var spine = (() => {
|
|
|
52
52
|
IkConstraintTimeline: () => IkConstraintTimeline,
|
|
53
53
|
IntSet: () => IntSet,
|
|
54
54
|
Interpolation: () => Interpolation,
|
|
55
|
-
JitterEffect: () => JitterEffect,
|
|
56
55
|
MathUtils: () => MathUtils,
|
|
57
56
|
MeshAttachment: () => MeshAttachment,
|
|
58
57
|
MixBlend: () => MixBlend,
|
|
@@ -97,7 +96,6 @@ var spine = (() => {
|
|
|
97
96
|
SlotData: () => SlotData,
|
|
98
97
|
SpacingMode: () => SpacingMode,
|
|
99
98
|
StringSet: () => StringSet,
|
|
100
|
-
SwirlEffect: () => SwirlEffect,
|
|
101
99
|
Texture: () => Texture,
|
|
102
100
|
TextureAtlas: () => TextureAtlas,
|
|
103
101
|
TextureAtlasPage: () => TextureAtlasPage,
|
|
@@ -516,7 +514,7 @@ var spine = (() => {
|
|
|
516
514
|
this.bones = null;
|
|
517
515
|
this.vertices = [];
|
|
518
516
|
this.worldVerticesLength = 0;
|
|
519
|
-
this.
|
|
517
|
+
this.timelineAttachment = this;
|
|
520
518
|
}
|
|
521
519
|
computeWorldVertices(slot, start, count, worldVertices, offset, stride) {
|
|
522
520
|
count = offset + (count >> 1) * stride;
|
|
@@ -587,7 +585,7 @@ var spine = (() => {
|
|
|
587
585
|
Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);
|
|
588
586
|
}
|
|
589
587
|
attachment.worldVerticesLength = this.worldVerticesLength;
|
|
590
|
-
attachment.
|
|
588
|
+
attachment.timelineAttachment = this.timelineAttachment;
|
|
591
589
|
}
|
|
592
590
|
};
|
|
593
591
|
var VertexAttachment = _VertexAttachment;
|
|
@@ -1886,7 +1884,7 @@ var spine = (() => {
|
|
|
1886
1884
|
let slotAttachment = slot.getAttachment();
|
|
1887
1885
|
if (!slotAttachment)
|
|
1888
1886
|
return;
|
|
1889
|
-
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.
|
|
1887
|
+
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != this.attachment)
|
|
1890
1888
|
return;
|
|
1891
1889
|
let deform = slot.deform;
|
|
1892
1890
|
if (deform.length == 0)
|
|
@@ -2465,7 +2463,7 @@ var spine = (() => {
|
|
|
2465
2463
|
let slotAttachment = slot.attachment;
|
|
2466
2464
|
let attachment = this.attachment;
|
|
2467
2465
|
if (slotAttachment != attachment) {
|
|
2468
|
-
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.
|
|
2466
|
+
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != attachment)
|
|
2469
2467
|
return;
|
|
2470
2468
|
}
|
|
2471
2469
|
let frames = this.frames;
|
|
@@ -2478,6 +2476,8 @@ var spine = (() => {
|
|
|
2478
2476
|
let before = frames[i];
|
|
2479
2477
|
let modeAndIndex = frames[i + _SequenceTimeline.MODE];
|
|
2480
2478
|
let delay = frames[i + _SequenceTimeline.DELAY];
|
|
2479
|
+
if (!this.attachment.sequence)
|
|
2480
|
+
return;
|
|
2481
2481
|
let index = modeAndIndex >> 4, count = this.attachment.sequence.regions.length;
|
|
2482
2482
|
let mode = SequenceModeValues[modeAndIndex & 15];
|
|
2483
2483
|
if (mode != SequenceMode.hold) {
|
|
@@ -2491,7 +2491,7 @@ var spine = (() => {
|
|
|
2491
2491
|
break;
|
|
2492
2492
|
case SequenceMode.pingpong: {
|
|
2493
2493
|
let n = (count << 1) - 2;
|
|
2494
|
-
index
|
|
2494
|
+
index = n == 0 ? 0 : index % n;
|
|
2495
2495
|
if (index >= count)
|
|
2496
2496
|
index = n - index;
|
|
2497
2497
|
break;
|
|
@@ -2504,7 +2504,7 @@ var spine = (() => {
|
|
|
2504
2504
|
break;
|
|
2505
2505
|
case SequenceMode.pingpongReverse: {
|
|
2506
2506
|
let n = (count << 1) - 2;
|
|
2507
|
-
index = (index + count - 1) % n;
|
|
2507
|
+
index = n == 0 ? 0 : (index + count - 1) % n;
|
|
2508
2508
|
if (index >= count)
|
|
2509
2509
|
index = n - index;
|
|
2510
2510
|
}
|
|
@@ -3792,7 +3792,7 @@ var spine = (() => {
|
|
|
3792
3792
|
let copy = new MeshAttachment(this.name, this.path);
|
|
3793
3793
|
copy.region = this.region;
|
|
3794
3794
|
copy.color.setFromColor(this.color);
|
|
3795
|
-
copy.
|
|
3795
|
+
copy.timelineAttachment = this.timelineAttachment;
|
|
3796
3796
|
copy.setParentMesh(this.parentMesh ? this.parentMesh : this);
|
|
3797
3797
|
if (copy.region != null)
|
|
3798
3798
|
copy.updateRegion();
|
|
@@ -5440,7 +5440,7 @@ var spine = (() => {
|
|
|
5440
5440
|
setAttachment(attachment) {
|
|
5441
5441
|
if (this.attachment == attachment)
|
|
5442
5442
|
return;
|
|
5443
|
-
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.
|
|
5443
|
+
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.timelineAttachment != this.attachment.timelineAttachment) {
|
|
5444
5444
|
this.deform.length = 0;
|
|
5445
5445
|
}
|
|
5446
5446
|
this.attachment = attachment;
|
|
@@ -6646,7 +6646,7 @@ var spine = (() => {
|
|
|
6646
6646
|
let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
|
|
6647
6647
|
if (!parent)
|
|
6648
6648
|
throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
|
|
6649
|
-
linkedMesh.mesh.
|
|
6649
|
+
linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
|
|
6650
6650
|
linkedMesh.mesh.setParentMesh(parent);
|
|
6651
6651
|
if (linkedMesh.mesh.region != null)
|
|
6652
6652
|
linkedMesh.mesh.updateRegion();
|
|
@@ -8453,7 +8453,7 @@ var spine = (() => {
|
|
|
8453
8453
|
let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
|
|
8454
8454
|
if (!parent)
|
|
8455
8455
|
throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
|
|
8456
|
-
linkedMesh.mesh.
|
|
8456
|
+
linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
|
|
8457
8457
|
linkedMesh.mesh.setParentMesh(parent);
|
|
8458
8458
|
if (linkedMesh.mesh.region != null)
|
|
8459
8459
|
linkedMesh.mesh.updateRegion();
|
|
@@ -9180,58 +9180,6 @@ var spine = (() => {
|
|
|
9180
9180
|
}
|
|
9181
9181
|
})();
|
|
9182
9182
|
|
|
9183
|
-
// spine-core/src/vertexeffects/JitterEffect.ts
|
|
9184
|
-
var JitterEffect = class {
|
|
9185
|
-
constructor(jitterX, jitterY) {
|
|
9186
|
-
this.jitterX = 0;
|
|
9187
|
-
this.jitterY = 0;
|
|
9188
|
-
this.jitterX = jitterX;
|
|
9189
|
-
this.jitterY = jitterY;
|
|
9190
|
-
}
|
|
9191
|
-
begin(skeleton) {
|
|
9192
|
-
}
|
|
9193
|
-
transform(position, uv, light, dark) {
|
|
9194
|
-
position.x += MathUtils.randomTriangular(-this.jitterX, this.jitterY);
|
|
9195
|
-
position.y += MathUtils.randomTriangular(-this.jitterX, this.jitterY);
|
|
9196
|
-
}
|
|
9197
|
-
end() {
|
|
9198
|
-
}
|
|
9199
|
-
};
|
|
9200
|
-
|
|
9201
|
-
// spine-core/src/vertexeffects/SwirlEffect.ts
|
|
9202
|
-
var _SwirlEffect = class {
|
|
9203
|
-
constructor(radius) {
|
|
9204
|
-
this.centerX = 0;
|
|
9205
|
-
this.centerY = 0;
|
|
9206
|
-
this.radius = 0;
|
|
9207
|
-
this.angle = 0;
|
|
9208
|
-
this.worldX = 0;
|
|
9209
|
-
this.worldY = 0;
|
|
9210
|
-
this.radius = radius;
|
|
9211
|
-
}
|
|
9212
|
-
begin(skeleton) {
|
|
9213
|
-
this.worldX = skeleton.x + this.centerX;
|
|
9214
|
-
this.worldY = skeleton.y + this.centerY;
|
|
9215
|
-
}
|
|
9216
|
-
transform(position, uv, light, dark) {
|
|
9217
|
-
let radAngle = this.angle * MathUtils.degreesToRadians;
|
|
9218
|
-
let x = position.x - this.worldX;
|
|
9219
|
-
let y = position.y - this.worldY;
|
|
9220
|
-
let dist = Math.sqrt(x * x + y * y);
|
|
9221
|
-
if (dist < this.radius) {
|
|
9222
|
-
let theta = _SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);
|
|
9223
|
-
let cos = Math.cos(theta);
|
|
9224
|
-
let sin = Math.sin(theta);
|
|
9225
|
-
position.x = cos * x - sin * y + this.worldX;
|
|
9226
|
-
position.y = sin * x + cos * y + this.worldY;
|
|
9227
|
-
}
|
|
9228
|
-
}
|
|
9229
|
-
end() {
|
|
9230
|
-
}
|
|
9231
|
-
};
|
|
9232
|
-
var SwirlEffect = _SwirlEffect;
|
|
9233
|
-
SwirlEffect.interpolation = new PowOut(2);
|
|
9234
|
-
|
|
9235
9183
|
// spine-canvas/src/CanvasTexture.ts
|
|
9236
9184
|
var CanvasTexture = class extends Texture {
|
|
9237
9185
|
constructor(image) {
|