@esotericsoftware/spine-core 4.1.2 → 4.1.6

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.
Files changed (96) hide show
  1. package/dist/Animation.d.ts +382 -382
  2. package/dist/Animation.js +2058 -2031
  3. package/dist/AnimationState.d.ts +396 -396
  4. package/dist/AnimationState.js +1083 -959
  5. package/dist/AnimationStateData.d.ts +51 -51
  6. package/dist/AnimationStateData.js +72 -70
  7. package/dist/AssetManagerBase.d.ts +74 -72
  8. package/dist/AssetManagerBase.js +304 -303
  9. package/dist/AtlasAttachmentLoader.d.ts +53 -53
  10. package/dist/AtlasAttachmentLoader.js +95 -94
  11. package/dist/Bone.d.ts +138 -138
  12. package/dist/Bone.js +340 -334
  13. package/dist/BoneData.d.ts +72 -72
  14. package/dist/BoneData.js +82 -74
  15. package/dist/ConstraintData.d.ts +35 -35
  16. package/dist/ConstraintData.js +36 -36
  17. package/dist/Event.d.ts +44 -44
  18. package/dist/Event.js +49 -42
  19. package/dist/EventData.d.ts +41 -41
  20. package/dist/EventData.js +44 -37
  21. package/dist/IkConstraint.d.ts +64 -64
  22. package/dist/IkConstraint.js +291 -285
  23. package/dist/IkConstraintData.d.ts +54 -54
  24. package/dist/IkConstraintData.js +56 -54
  25. package/dist/PathConstraint.d.ts +71 -71
  26. package/dist/PathConstraint.js +475 -469
  27. package/dist/PathConstraintData.d.ts +80 -80
  28. package/dist/PathConstraintData.js +84 -70
  29. package/dist/Skeleton.d.ts +152 -152
  30. package/dist/Skeleton.js +581 -563
  31. package/dist/SkeletonBinary.d.ts +68 -68
  32. package/dist/SkeletonBinary.js +1132 -1131
  33. package/dist/SkeletonBounds.d.ts +77 -77
  34. package/dist/SkeletonBounds.js +218 -218
  35. package/dist/SkeletonClipping.d.ts +50 -50
  36. package/dist/SkeletonClipping.js +323 -323
  37. package/dist/SkeletonData.d.ts +114 -114
  38. package/dist/SkeletonData.js +190 -167
  39. package/dist/SkeletonJson.d.ts +53 -53
  40. package/dist/SkeletonJson.js +954 -953
  41. package/dist/Skin.d.ts +71 -71
  42. package/dist/Skin.js +203 -201
  43. package/dist/Slot.d.ts +69 -69
  44. package/dist/Slot.js +97 -85
  45. package/dist/SlotData.d.ts +57 -57
  46. package/dist/SlotData.js +68 -55
  47. package/dist/Texture.d.ts +69 -69
  48. package/dist/Texture.js +72 -72
  49. package/dist/TextureAtlas.d.ts +65 -65
  50. package/dist/TextureAtlas.js +267 -246
  51. package/dist/TransformConstraint.d.ts +60 -60
  52. package/dist/TransformConstraint.js +246 -240
  53. package/dist/TransformConstraintData.d.ts +60 -60
  54. package/dist/TransformConstraintData.js +62 -60
  55. package/dist/Triangulator.d.ts +43 -43
  56. package/dist/Triangulator.js +243 -243
  57. package/dist/Updatable.d.ts +37 -37
  58. package/dist/Updatable.js +29 -29
  59. package/dist/Utils.d.ts +168 -168
  60. package/dist/Utils.js +403 -403
  61. package/dist/VertexEffect.d.ts +35 -35
  62. package/dist/VertexEffect.js +29 -29
  63. package/dist/attachments/Attachment.d.ts +72 -72
  64. package/dist/attachments/Attachment.js +149 -141
  65. package/dist/attachments/AttachmentLoader.d.ts +54 -54
  66. package/dist/attachments/AttachmentLoader.js +29 -29
  67. package/dist/attachments/BoundingBoxAttachment.d.ts +40 -40
  68. package/dist/attachments/BoundingBoxAttachment.js +47 -47
  69. package/dist/attachments/ClippingAttachment.d.ts +42 -42
  70. package/dist/attachments/ClippingAttachment.js +51 -48
  71. package/dist/attachments/HasTextureRegion.d.ts +44 -44
  72. package/dist/attachments/HasTextureRegion.js +29 -29
  73. package/dist/attachments/MeshAttachment.d.ts +79 -79
  74. package/dist/attachments/MeshAttachment.js +189 -167
  75. package/dist/attachments/PathAttachment.d.ts +47 -47
  76. package/dist/attachments/PathAttachment.js +59 -57
  77. package/dist/attachments/PointAttachment.d.ts +48 -48
  78. package/dist/attachments/PointAttachment.js +66 -63
  79. package/dist/attachments/RegionAttachment.d.ts +111 -111
  80. package/dist/attachments/RegionAttachment.js +204 -199
  81. package/dist/attachments/Sequence.d.ts +55 -55
  82. package/dist/attachments/Sequence.js +90 -90
  83. package/dist/attachments/index.d.ts +8 -8
  84. package/dist/attachments/index.js +8 -8
  85. package/dist/iife/spine-core.js +178 -8
  86. package/dist/iife/spine-core.js.map +2 -2
  87. package/dist/iife/spine-core.min.js +2 -2
  88. package/dist/index.d.ts +42 -42
  89. package/dist/index.js +42 -42
  90. package/dist/polyfills.d.ts +29 -29
  91. package/dist/polyfills.js +38 -38
  92. package/dist/vertexeffects/JitterEffect.d.ts +39 -39
  93. package/dist/vertexeffects/JitterEffect.js +45 -45
  94. package/dist/vertexeffects/SwirlEffect.d.ts +44 -44
  95. package/dist/vertexeffects/SwirlEffect.js +60 -60
  96. package/package.json +32 -32
package/dist/Slot.d.ts CHANGED
@@ -1,69 +1,69 @@
1
- /******************************************************************************
2
- * Spine Runtimes License Agreement
3
- * Last updated September 24, 2021. Replaces all prior versions.
4
- *
5
- * Copyright (c) 2013-2021, Esoteric Software LLC
6
- *
7
- * Integration of the Spine Runtimes into software or otherwise creating
8
- * derivative works of the Spine Runtimes is permitted under the terms and
9
- * conditions of Section 2 of the Spine Editor License Agreement:
10
- * http://esotericsoftware.com/spine-editor-license
11
- *
12
- * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
- * or otherwise create derivative works of the Spine Runtimes (collectively,
14
- * "Products"), provided that each user of the Products must obtain their own
15
- * Spine Editor license and redistribution of the Products in any form must
16
- * include this license and copyright notice.
17
- *
18
- * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
- * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
- * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- *****************************************************************************/
29
- import { Attachment } from "./attachments/Attachment";
30
- import { Bone } from "./Bone";
31
- import { Skeleton } from "./Skeleton";
32
- import { SlotData } from "./SlotData";
33
- import { Color } from "./Utils";
34
- /** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
35
- * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
36
- * across multiple skeletons. */
37
- export declare class Slot {
38
- /** The slot's setup pose data. */
39
- data: SlotData;
40
- /** The bone this slot belongs to. */
41
- bone: Bone;
42
- /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
43
- * color tinting. */
44
- color: Color;
45
- /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
46
- * color's alpha is not used. */
47
- darkColor: Color;
48
- attachment: Attachment;
49
- attachmentState: number;
50
- /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the
51
- * {@link Sequence#getSetupIndex()}. */
52
- sequenceIndex: number;
53
- /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
54
- * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
55
- *
56
- * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
57
- deform: number[];
58
- constructor(data: SlotData, bone: Bone);
59
- /** The skeleton this slot belongs to. */
60
- getSkeleton(): Skeleton;
61
- /** The current attachment for the slot, or null if the slot has no attachment. */
62
- getAttachment(): Attachment;
63
- /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.
64
- * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the
65
- * specified attachment. */
66
- setAttachment(attachment: Attachment): void;
67
- /** Sets this slot to the setup pose. */
68
- setToSetupPose(): void;
69
- }
1
+ /******************************************************************************
2
+ * Spine Runtimes License Agreement
3
+ * Last updated September 24, 2021. Replaces all prior versions.
4
+ *
5
+ * Copyright (c) 2013-2021, Esoteric Software LLC
6
+ *
7
+ * Integration of the Spine Runtimes into software or otherwise creating
8
+ * derivative works of the Spine Runtimes is permitted under the terms and
9
+ * conditions of Section 2 of the Spine Editor License Agreement:
10
+ * http://esotericsoftware.com/spine-editor-license
11
+ *
12
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
14
+ * "Products"), provided that each user of the Products must obtain their own
15
+ * Spine Editor license and redistribution of the Products in any form must
16
+ * include this license and copyright notice.
17
+ *
18
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *****************************************************************************/
29
+ import { Attachment } from "./attachments/Attachment";
30
+ import { Bone } from "./Bone";
31
+ import { Skeleton } from "./Skeleton";
32
+ import { SlotData } from "./SlotData";
33
+ import { Color } from "./Utils";
34
+ /** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
35
+ * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
36
+ * across multiple skeletons. */
37
+ export declare class Slot {
38
+ /** The slot's setup pose data. */
39
+ data: SlotData;
40
+ /** The bone this slot belongs to. */
41
+ bone: Bone;
42
+ /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
43
+ * color tinting. */
44
+ color: Color;
45
+ /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
46
+ * color's alpha is not used. */
47
+ darkColor: Color;
48
+ attachment: Attachment;
49
+ attachmentState: number;
50
+ /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the
51
+ * {@link Sequence#getSetupIndex()}. */
52
+ sequenceIndex: number;
53
+ /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
54
+ * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
55
+ *
56
+ * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
57
+ deform: number[];
58
+ constructor(data: SlotData, bone: Bone);
59
+ /** The skeleton this slot belongs to. */
60
+ getSkeleton(): Skeleton;
61
+ /** The current attachment for the slot, or null if the slot has no attachment. */
62
+ getAttachment(): Attachment;
63
+ /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.
64
+ * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the
65
+ * specified attachment. */
66
+ setAttachment(attachment: Attachment): void;
67
+ /** Sets this slot to the setup pose. */
68
+ setToSetupPose(): void;
69
+ }
package/dist/Slot.js CHANGED
@@ -1,85 +1,97 @@
1
- /******************************************************************************
2
- * Spine Runtimes License Agreement
3
- * Last updated September 24, 2021. Replaces all prior versions.
4
- *
5
- * Copyright (c) 2013-2021, Esoteric Software LLC
6
- *
7
- * Integration of the Spine Runtimes into software or otherwise creating
8
- * derivative works of the Spine Runtimes is permitted under the terms and
9
- * conditions of Section 2 of the Spine Editor License Agreement:
10
- * http://esotericsoftware.com/spine-editor-license
11
- *
12
- * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
- * or otherwise create derivative works of the Spine Runtimes (collectively,
14
- * "Products"), provided that each user of the Products must obtain their own
15
- * Spine Editor license and redistribution of the Products in any form must
16
- * include this license and copyright notice.
17
- *
18
- * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
- * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
- * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- *****************************************************************************/
29
- import { VertexAttachment } from "./attachments/Attachment";
30
- import { Color } from "./Utils";
31
- /** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
32
- * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
33
- * across multiple skeletons. */
34
- export class Slot {
35
- constructor(data, bone) {
36
- /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
37
- * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
38
- *
39
- * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
40
- this.deform = new Array();
41
- if (!data)
42
- throw new Error("data cannot be null.");
43
- if (!bone)
44
- throw new Error("bone cannot be null.");
45
- this.data = data;
46
- this.bone = bone;
47
- this.color = new Color();
48
- this.darkColor = !data.darkColor ? null : new Color();
49
- this.setToSetupPose();
50
- }
51
- /** The skeleton this slot belongs to. */
52
- getSkeleton() {
53
- return this.bone.skeleton;
54
- }
55
- /** The current attachment for the slot, or null if the slot has no attachment. */
56
- getAttachment() {
57
- return this.attachment;
58
- }
59
- /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.
60
- * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the
61
- * specified attachment. */
62
- setAttachment(attachment) {
63
- if (this.attachment == attachment)
64
- return;
65
- if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)
66
- || attachment.timelineAttahment != this.attachment.timelineAttahment) {
67
- this.deform.length = 0;
68
- }
69
- this.attachment = attachment;
70
- this.sequenceIndex = -1;
71
- }
72
- /** Sets this slot to the setup pose. */
73
- setToSetupPose() {
74
- this.color.setFromColor(this.data.color);
75
- if (this.darkColor)
76
- this.darkColor.setFromColor(this.data.darkColor);
77
- if (!this.data.attachmentName)
78
- this.attachment = null;
79
- else {
80
- this.attachment = null;
81
- this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));
82
- }
83
-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LGFBQWEsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxhQUFhLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDO1NBQ2hHO0lBQ0YsQ0FBQztDQUNEIn0=
1
+ /******************************************************************************
2
+ * Spine Runtimes License Agreement
3
+ * Last updated September 24, 2021. Replaces all prior versions.
4
+ *
5
+ * Copyright (c) 2013-2021, Esoteric Software LLC
6
+ *
7
+ * Integration of the Spine Runtimes into software or otherwise creating
8
+ * derivative works of the Spine Runtimes is permitted under the terms and
9
+ * conditions of Section 2 of the Spine Editor License Agreement:
10
+ * http://esotericsoftware.com/spine-editor-license
11
+ *
12
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
14
+ * "Products"), provided that each user of the Products must obtain their own
15
+ * Spine Editor license and redistribution of the Products in any form must
16
+ * include this license and copyright notice.
17
+ *
18
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *****************************************************************************/
29
+ import { VertexAttachment } from "./attachments/Attachment";
30
+ import { Color } from "./Utils";
31
+ /** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
32
+ * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
33
+ * across multiple skeletons. */
34
+ export class Slot {
35
+ constructor(data, bone) {
36
+ /** The slot's setup pose data. */
37
+ this.data = null;
38
+ /** The bone this slot belongs to. */
39
+ this.bone = null;
40
+ /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
41
+ * color tinting. */
42
+ this.color = null;
43
+ /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
44
+ * color's alpha is not used. */
45
+ this.darkColor = null;
46
+ this.attachment = null;
47
+ this.attachmentState = 0;
48
+ /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
49
+ * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
50
+ *
51
+ * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
52
+ this.deform = new Array();
53
+ if (!data)
54
+ throw new Error("data cannot be null.");
55
+ if (!bone)
56
+ throw new Error("bone cannot be null.");
57
+ this.data = data;
58
+ this.bone = bone;
59
+ this.color = new Color();
60
+ this.darkColor = !data.darkColor ? null : new Color();
61
+ this.setToSetupPose();
62
+ }
63
+ /** The skeleton this slot belongs to. */
64
+ getSkeleton() {
65
+ return this.bone.skeleton;
66
+ }
67
+ /** The current attachment for the slot, or null if the slot has no attachment. */
68
+ getAttachment() {
69
+ return this.attachment;
70
+ }
71
+ /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.
72
+ * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the
73
+ * specified attachment. */
74
+ setAttachment(attachment) {
75
+ if (this.attachment == attachment)
76
+ return;
77
+ if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)
78
+ || attachment.timelineAttahment != this.attachment.timelineAttahment) {
79
+ this.deform.length = 0;
80
+ }
81
+ this.attachment = attachment;
82
+ this.sequenceIndex = -1;
83
+ }
84
+ /** Sets this slot to the setup pose. */
85
+ setToSetupPose() {
86
+ this.color.setFromColor(this.data.color);
87
+ if (this.darkColor)
88
+ this.darkColor.setFromColor(this.data.darkColor);
89
+ if (!this.data.attachmentName)
90
+ this.attachment = null;
91
+ else {
92
+ this.attachment = null;
93
+ this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));
94
+ }
95
+ }
96
+ }
97
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2xvdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9TbG90LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7K0VBMkIrRTtBQUUvRSxPQUFPLEVBQWMsZ0JBQWdCLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUl4RSxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBRWhDOztnQ0FFZ0M7QUFDaEMsTUFBTSxPQUFPLElBQUk7SUE2QmhCLFlBQWEsSUFBYyxFQUFFLElBQVU7UUE1QnZDLGtDQUFrQztRQUNsQyxTQUFJLEdBQWEsSUFBSSxDQUFDO1FBRXRCLHFDQUFxQztRQUNyQyxTQUFJLEdBQVMsSUFBSSxDQUFDO1FBRWxCOzRCQUNvQjtRQUNwQixVQUFLLEdBQVUsSUFBSSxDQUFDO1FBRXBCO3dDQUNnQztRQUNoQyxjQUFTLEdBQVUsSUFBSSxDQUFDO1FBRX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FDeEUsVUFBVyxDQUFDLGlCQUFpQixJQUF1QixJQUFJLENBQUMsVUFBVyxDQUFDLGlCQUFpQixFQUFFO1lBQzlHLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQztTQUN2QjtRQUNELElBQUksQ0FBQyxVQUFVLEdBQUcsVUFBVSxDQUFDO1FBQzdCLElBQUksQ0FBQyxhQUFhLEdBQUcsQ0FBQyxDQUFDLENBQUM7SUFDekIsQ0FBQztJQUVELHdDQUF3QztJQUN4QyxjQUFjO1FBQ2IsSUFBSSxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUN6QyxJQUFJLElBQUksQ0FBQyxTQUFTO1lBQUUsSUFBSSxDQUFDLFNBQVMsQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUNyRSxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxjQUFjO1lBQzVCLElBQUksQ0FBQyxVQUFVLEdBQUcsSUFBSSxDQUFDO2FBQ25CO1lBQ0osSUFBSSxDQUFDLFVBQVUsR0FBRyxJQUFJLENBQUM7WUFDdkIsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxhQUFhLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDO1NBQ2hHO0lBQ0YsQ0FBQztDQUNEIn0=
@@ -1,57 +1,57 @@
1
- /******************************************************************************
2
- * Spine Runtimes License Agreement
3
- * Last updated September 24, 2021. Replaces all prior versions.
4
- *
5
- * Copyright (c) 2013-2021, Esoteric Software LLC
6
- *
7
- * Integration of the Spine Runtimes into software or otherwise creating
8
- * derivative works of the Spine Runtimes is permitted under the terms and
9
- * conditions of Section 2 of the Spine Editor License Agreement:
10
- * http://esotericsoftware.com/spine-editor-license
11
- *
12
- * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
- * or otherwise create derivative works of the Spine Runtimes (collectively,
14
- * "Products"), provided that each user of the Products must obtain their own
15
- * Spine Editor license and redistribution of the Products in any form must
16
- * include this license and copyright notice.
17
- *
18
- * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
- * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
- * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- *****************************************************************************/
29
- import { BoneData } from "./BoneData";
30
- import { Color } from "./Utils";
31
- /** Stores the setup pose for a {@link Slot}. */
32
- export declare class SlotData {
33
- /** The index of the slot in {@link Skeleton#getSlots()}. */
34
- index: number;
35
- /** The name of the slot, which is unique across all slots in the skeleton. */
36
- name: string;
37
- /** The bone this slot belongs to. */
38
- boneData: BoneData;
39
- /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
40
- * color tinting. */
41
- color: Color;
42
- /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
43
- * color's alpha is not used. */
44
- darkColor: Color;
45
- /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
46
- attachmentName: string;
47
- /** The blend mode for drawing the slot's attachment. */
48
- blendMode: BlendMode;
49
- constructor(index: number, name: string, boneData: BoneData);
50
- }
51
- /** Determines how images are blended with existing pixels when drawn. */
52
- export declare enum BlendMode {
53
- Normal = 0,
54
- Additive = 1,
55
- Multiply = 2,
56
- Screen = 3
57
- }
1
+ /******************************************************************************
2
+ * Spine Runtimes License Agreement
3
+ * Last updated September 24, 2021. Replaces all prior versions.
4
+ *
5
+ * Copyright (c) 2013-2021, Esoteric Software LLC
6
+ *
7
+ * Integration of the Spine Runtimes into software or otherwise creating
8
+ * derivative works of the Spine Runtimes is permitted under the terms and
9
+ * conditions of Section 2 of the Spine Editor License Agreement:
10
+ * http://esotericsoftware.com/spine-editor-license
11
+ *
12
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
14
+ * "Products"), provided that each user of the Products must obtain their own
15
+ * Spine Editor license and redistribution of the Products in any form must
16
+ * include this license and copyright notice.
17
+ *
18
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *****************************************************************************/
29
+ import { BoneData } from "./BoneData";
30
+ import { Color } from "./Utils";
31
+ /** Stores the setup pose for a {@link Slot}. */
32
+ export declare class SlotData {
33
+ /** The index of the slot in {@link Skeleton#getSlots()}. */
34
+ index: number;
35
+ /** The name of the slot, which is unique across all slots in the skeleton. */
36
+ name: string;
37
+ /** The bone this slot belongs to. */
38
+ boneData: BoneData;
39
+ /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
40
+ * color tinting. */
41
+ color: Color;
42
+ /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
43
+ * color's alpha is not used. */
44
+ darkColor: Color;
45
+ /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
46
+ attachmentName: string;
47
+ /** The blend mode for drawing the slot's attachment. */
48
+ blendMode: BlendMode;
49
+ constructor(index: number, name: string, boneData: BoneData);
50
+ }
51
+ /** Determines how images are blended with existing pixels when drawn. */
52
+ export declare enum BlendMode {
53
+ Normal = 0,
54
+ Additive = 1,
55
+ Multiply = 2,
56
+ Screen = 3
57
+ }
package/dist/SlotData.js CHANGED
@@ -1,55 +1,68 @@
1
- /******************************************************************************
2
- * Spine Runtimes License Agreement
3
- * Last updated September 24, 2021. Replaces all prior versions.
4
- *
5
- * Copyright (c) 2013-2021, Esoteric Software LLC
6
- *
7
- * Integration of the Spine Runtimes into software or otherwise creating
8
- * derivative works of the Spine Runtimes is permitted under the terms and
9
- * conditions of Section 2 of the Spine Editor License Agreement:
10
- * http://esotericsoftware.com/spine-editor-license
11
- *
12
- * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
- * or otherwise create derivative works of the Spine Runtimes (collectively,
14
- * "Products"), provided that each user of the Products must obtain their own
15
- * Spine Editor license and redistribution of the Products in any form must
16
- * include this license and copyright notice.
17
- *
18
- * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
- * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
- * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- *****************************************************************************/
29
- import { Color } from "./Utils";
30
- /** Stores the setup pose for a {@link Slot}. */
31
- export class SlotData {
32
- constructor(index, name, boneData) {
33
- /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
34
- * color tinting. */
35
- this.color = new Color(1, 1, 1, 1);
36
- if (index < 0)
37
- throw new Error("index must be >= 0.");
38
- if (!name)
39
- throw new Error("name cannot be null.");
40
- if (!boneData)
41
- throw new Error("boneData cannot be null.");
42
- this.index = index;
43
- this.name = name;
44
- this.boneData = boneData;
45
- }
46
- }
47
- /** Determines how images are blended with existing pixels when drawn. */
48
- export var BlendMode;
49
- (function (BlendMode) {
50
- BlendMode[BlendMode["Normal"] = 0] = "Normal";
51
- BlendMode[BlendMode["Additive"] = 1] = "Additive";
52
- BlendMode[BlendMode["Multiply"] = 2] = "Multiply";
53
- BlendMode[BlendMode["Screen"] = 3] = "Screen";
54
- })(BlendMode || (BlendMode = {}));
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2xvdERhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvU2xvdERhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsrRUEyQitFO0FBRy9FLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFFaEMsZ0RBQWdEO0FBQ2hELE1BQU0sT0FBTyxRQUFRO0lBd0JwQixZQUFhLEtBQWEsRUFBRSxJQUFZLEVBQUUsUUFBa0I7UUFkNUQ7NEJBQ29CO1FBQ3BCLFVBQUssR0FBRyxJQUFJLEtBQUssQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztRQWE3QixJQUFJLEtBQUssR0FBRyxDQUFDO1lBQUUsTUFBTSxJQUFJLEtBQUssQ0FBQyxxQkFBcUIsQ0FBQyxDQUFDO1FBQ3RELElBQUksQ0FBQyxJQUFJO1lBQUUsTUFBTSxJQUFJLEtBQUssQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO1FBQ25ELElBQUksQ0FBQyxRQUFRO1lBQUUsTUFBTSxJQUFJLEtBQUssQ0FBQywwQkFBMEIsQ0FBQyxDQUFDO1FBQzNELElBQUksQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFDO1FBQ25CLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO1FBQ2pCLElBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDO0lBQzFCLENBQUM7Q0FDRDtBQUVELHlFQUF5RTtBQUN6RSxNQUFNLENBQU4sSUFBWSxTQUFnRDtBQUE1RCxXQUFZLFNBQVM7SUFBRyw2Q0FBTSxDQUFBO0lBQUUsaURBQVEsQ0FBQTtJQUFFLGlEQUFRLENBQUE7SUFBRSw2Q0FBTSxDQUFBO0FBQUMsQ0FBQyxFQUFoRCxTQUFTLEtBQVQsU0FBUyxRQUF1QyJ9
1
+ /******************************************************************************
2
+ * Spine Runtimes License Agreement
3
+ * Last updated September 24, 2021. Replaces all prior versions.
4
+ *
5
+ * Copyright (c) 2013-2021, Esoteric Software LLC
6
+ *
7
+ * Integration of the Spine Runtimes into software or otherwise creating
8
+ * derivative works of the Spine Runtimes is permitted under the terms and
9
+ * conditions of Section 2 of the Spine Editor License Agreement:
10
+ * http://esotericsoftware.com/spine-editor-license
11
+ *
12
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
14
+ * "Products"), provided that each user of the Products must obtain their own
15
+ * Spine Editor license and redistribution of the Products in any form must
16
+ * include this license and copyright notice.
17
+ *
18
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *****************************************************************************/
29
+ import { Color } from "./Utils";
30
+ /** Stores the setup pose for a {@link Slot}. */
31
+ export class SlotData {
32
+ constructor(index, name, boneData) {
33
+ /** The index of the slot in {@link Skeleton#getSlots()}. */
34
+ this.index = 0;
35
+ /** The name of the slot, which is unique across all slots in the skeleton. */
36
+ this.name = null;
37
+ /** The bone this slot belongs to. */
38
+ this.boneData = null;
39
+ /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
40
+ * color tinting. */
41
+ this.color = new Color(1, 1, 1, 1);
42
+ /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
43
+ * color's alpha is not used. */
44
+ this.darkColor = null;
45
+ /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
46
+ this.attachmentName = null;
47
+ /** The blend mode for drawing the slot's attachment. */
48
+ this.blendMode = null;
49
+ if (index < 0)
50
+ throw new Error("index must be >= 0.");
51
+ if (!name)
52
+ throw new Error("name cannot be null.");
53
+ if (!boneData)
54
+ throw new Error("boneData cannot be null.");
55
+ this.index = index;
56
+ this.name = name;
57
+ this.boneData = boneData;
58
+ }
59
+ }
60
+ /** Determines how images are blended with existing pixels when drawn. */
61
+ export var BlendMode;
62
+ (function (BlendMode) {
63
+ BlendMode[BlendMode["Normal"] = 0] = "Normal";
64
+ BlendMode[BlendMode["Additive"] = 1] = "Additive";
65
+ BlendMode[BlendMode["Multiply"] = 2] = "Multiply";
66
+ BlendMode[BlendMode["Screen"] = 3] = "Screen";
67
+ })(BlendMode || (BlendMode = {}));
68
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2xvdERhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvU2xvdERhdGE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