@esotericsoftware/spine-core 4.1.25 → 4.1.26

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 (90) hide show
  1. package/dist/Animation.d.ts +382 -0
  2. package/dist/Animation.js +2052 -0
  3. package/dist/AnimationState.d.ts +398 -0
  4. package/dist/AnimationState.js +1096 -0
  5. package/dist/AnimationStateData.d.ts +51 -0
  6. package/dist/AnimationStateData.js +70 -0
  7. package/dist/AssetManagerBase.d.ts +75 -0
  8. package/dist/AssetManagerBase.js +320 -0
  9. package/dist/AtlasAttachmentLoader.d.ts +53 -0
  10. package/dist/AtlasAttachmentLoader.js +95 -0
  11. package/dist/Bone.d.ts +138 -0
  12. package/dist/Bone.js +336 -0
  13. package/dist/BoneData.d.ts +72 -0
  14. package/dist/BoneData.js +80 -0
  15. package/dist/ConstraintData.d.ts +35 -0
  16. package/dist/ConstraintData.js +37 -0
  17. package/dist/Event.d.ts +44 -0
  18. package/dist/Event.js +48 -0
  19. package/dist/EventData.d.ts +41 -0
  20. package/dist/EventData.js +43 -0
  21. package/dist/IkConstraint.d.ts +64 -0
  22. package/dist/IkConstraint.js +296 -0
  23. package/dist/IkConstraintData.d.ts +56 -0
  24. package/dist/IkConstraintData.js +63 -0
  25. package/dist/PathConstraint.d.ts +71 -0
  26. package/dist/PathConstraint.js +476 -0
  27. package/dist/PathConstraintData.d.ts +82 -0
  28. package/dist/PathConstraintData.js +91 -0
  29. package/dist/Skeleton.d.ts +163 -0
  30. package/dist/Skeleton.js +588 -0
  31. package/dist/SkeletonBinary.d.ts +68 -0
  32. package/dist/SkeletonBinary.js +1172 -0
  33. package/dist/SkeletonBounds.d.ts +77 -0
  34. package/dist/SkeletonBounds.js +219 -0
  35. package/dist/SkeletonClipping.d.ts +50 -0
  36. package/dist/SkeletonClipping.js +326 -0
  37. package/dist/SkeletonData.d.ts +114 -0
  38. package/dist/SkeletonData.js +190 -0
  39. package/dist/SkeletonJson.d.ts +53 -0
  40. package/dist/SkeletonJson.js +1027 -0
  41. package/dist/Skin.d.ts +71 -0
  42. package/dist/Skin.js +201 -0
  43. package/dist/Slot.d.ts +69 -0
  44. package/dist/Slot.js +93 -0
  45. package/dist/SlotData.d.ts +57 -0
  46. package/dist/SlotData.js +64 -0
  47. package/dist/Texture.d.ts +69 -0
  48. package/dist/Texture.js +73 -0
  49. package/dist/TextureAtlas.d.ts +67 -0
  50. package/dist/TextureAtlas.js +263 -0
  51. package/dist/TransformConstraint.d.ts +60 -0
  52. package/dist/TransformConstraint.js +247 -0
  53. package/dist/TransformConstraintData.d.ts +62 -0
  54. package/dist/TransformConstraintData.js +69 -0
  55. package/dist/Triangulator.d.ts +43 -0
  56. package/dist/Triangulator.js +244 -0
  57. package/dist/Updatable.d.ts +37 -0
  58. package/dist/Updatable.js +30 -0
  59. package/dist/Utils.d.ts +168 -0
  60. package/dist/Utils.js +404 -0
  61. package/dist/attachments/Attachment.d.ts +72 -0
  62. package/dist/attachments/Attachment.js +147 -0
  63. package/dist/attachments/AttachmentLoader.d.ts +54 -0
  64. package/dist/attachments/AttachmentLoader.js +30 -0
  65. package/dist/attachments/BoundingBoxAttachment.d.ts +40 -0
  66. package/dist/attachments/BoundingBoxAttachment.js +48 -0
  67. package/dist/attachments/ClippingAttachment.d.ts +42 -0
  68. package/dist/attachments/ClippingAttachment.js +51 -0
  69. package/dist/attachments/HasTextureRegion.d.ts +44 -0
  70. package/dist/attachments/HasTextureRegion.js +30 -0
  71. package/dist/attachments/MeshAttachment.d.ts +79 -0
  72. package/dist/attachments/MeshAttachment.js +188 -0
  73. package/dist/attachments/PathAttachment.d.ts +47 -0
  74. package/dist/attachments/PathAttachment.js +59 -0
  75. package/dist/attachments/PointAttachment.d.ts +48 -0
  76. package/dist/attachments/PointAttachment.js +66 -0
  77. package/dist/attachments/RegionAttachment.d.ts +111 -0
  78. package/dist/attachments/RegionAttachment.js +215 -0
  79. package/dist/attachments/Sequence.d.ts +55 -0
  80. package/dist/attachments/Sequence.js +91 -0
  81. package/dist/attachments/index.d.ts +8 -0
  82. package/dist/attachments/index.js +9 -0
  83. package/dist/iife/spine-core.js +10703 -0
  84. package/dist/iife/spine-core.js.map +7 -0
  85. package/dist/iife/spine-core.min.js +2 -0
  86. package/dist/index.d.ts +39 -0
  87. package/dist/index.js +40 -0
  88. package/dist/polyfills.d.ts +29 -0
  89. package/dist/polyfills.js +39 -0
  90. package/package.json +1 -1
package/dist/Skin.d.ts ADDED
@@ -0,0 +1,71 @@
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 { BoneData } from "./BoneData";
31
+ import { ConstraintData } from "./ConstraintData";
32
+ import { Skeleton } from "./Skeleton";
33
+ import { StringMap } from "./Utils";
34
+ /** Stores an entry in the skin consisting of the slot index, name, and attachment **/
35
+ export declare class SkinEntry {
36
+ slotIndex: number;
37
+ name: string;
38
+ attachment: Attachment;
39
+ constructor(slotIndex: number, name: string, attachment: Attachment);
40
+ }
41
+ /** Stores attachments by slot index and attachment name.
42
+ *
43
+ * See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and
44
+ * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. */
45
+ export declare class Skin {
46
+ /** The skin's name, which is unique across all skins in the skeleton. */
47
+ name: string;
48
+ attachments: StringMap<Attachment>[];
49
+ bones: BoneData[];
50
+ constraints: ConstraintData[];
51
+ constructor(name: string);
52
+ /** Adds an attachment to the skin for the specified slot index and name. */
53
+ setAttachment(slotIndex: number, name: string, attachment: Attachment): void;
54
+ /** Adds all attachments, bones, and constraints from the specified skin to this skin. */
55
+ addSkin(skin: Skin): void;
56
+ /** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not
57
+ * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */
58
+ copySkin(skin: Skin): void;
59
+ /** Returns the attachment for the specified slot index and name, or null. */
60
+ getAttachment(slotIndex: number, name: string): Attachment | null;
61
+ /** Removes the attachment in the skin for the specified slot index and name, if any. */
62
+ removeAttachment(slotIndex: number, name: string): void;
63
+ /** Returns all attachments in this skin. */
64
+ getAttachments(): Array<SkinEntry>;
65
+ /** Returns all attachments in this skin for the specified slot index. */
66
+ getAttachmentsForSlot(slotIndex: number, attachments: Array<SkinEntry>): void;
67
+ /** Clears all attachments, bones, and constraints. */
68
+ clear(): void;
69
+ /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */
70
+ attachAll(skeleton: Skeleton, oldSkin: Skin): void;
71
+ }
package/dist/Skin.js ADDED
@@ -0,0 +1,201 @@
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 { MeshAttachment } from "./attachments/MeshAttachment";
30
+ /** Stores an entry in the skin consisting of the slot index, name, and attachment **/
31
+ export class SkinEntry {
32
+ constructor(slotIndex = 0, name, attachment) {
33
+ this.slotIndex = slotIndex;
34
+ this.name = name;
35
+ this.attachment = attachment;
36
+ }
37
+ }
38
+ /** Stores attachments by slot index and attachment name.
39
+ *
40
+ * See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and
41
+ * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. */
42
+ export class Skin {
43
+ constructor(name) {
44
+ this.attachments = new Array();
45
+ this.bones = Array();
46
+ this.constraints = new Array();
47
+ if (!name)
48
+ throw new Error("name cannot be null.");
49
+ this.name = name;
50
+ }
51
+ /** Adds an attachment to the skin for the specified slot index and name. */
52
+ setAttachment(slotIndex, name, attachment) {
53
+ if (!attachment)
54
+ throw new Error("attachment cannot be null.");
55
+ let attachments = this.attachments;
56
+ if (slotIndex >= attachments.length)
57
+ attachments.length = slotIndex + 1;
58
+ if (!attachments[slotIndex])
59
+ attachments[slotIndex] = {};
60
+ attachments[slotIndex][name] = attachment;
61
+ }
62
+ /** Adds all attachments, bones, and constraints from the specified skin to this skin. */
63
+ addSkin(skin) {
64
+ for (let i = 0; i < skin.bones.length; i++) {
65
+ let bone = skin.bones[i];
66
+ let contained = false;
67
+ for (let ii = 0; ii < this.bones.length; ii++) {
68
+ if (this.bones[ii] == bone) {
69
+ contained = true;
70
+ break;
71
+ }
72
+ }
73
+ if (!contained)
74
+ this.bones.push(bone);
75
+ }
76
+ for (let i = 0; i < skin.constraints.length; i++) {
77
+ let constraint = skin.constraints[i];
78
+ let contained = false;
79
+ for (let ii = 0; ii < this.constraints.length; ii++) {
80
+ if (this.constraints[ii] == constraint) {
81
+ contained = true;
82
+ break;
83
+ }
84
+ }
85
+ if (!contained)
86
+ this.constraints.push(constraint);
87
+ }
88
+ let attachments = skin.getAttachments();
89
+ for (let i = 0; i < attachments.length; i++) {
90
+ var attachment = attachments[i];
91
+ this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);
92
+ }
93
+ }
94
+ /** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not
95
+ * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */
96
+ copySkin(skin) {
97
+ for (let i = 0; i < skin.bones.length; i++) {
98
+ let bone = skin.bones[i];
99
+ let contained = false;
100
+ for (let ii = 0; ii < this.bones.length; ii++) {
101
+ if (this.bones[ii] == bone) {
102
+ contained = true;
103
+ break;
104
+ }
105
+ }
106
+ if (!contained)
107
+ this.bones.push(bone);
108
+ }
109
+ for (let i = 0; i < skin.constraints.length; i++) {
110
+ let constraint = skin.constraints[i];
111
+ let contained = false;
112
+ for (let ii = 0; ii < this.constraints.length; ii++) {
113
+ if (this.constraints[ii] == constraint) {
114
+ contained = true;
115
+ break;
116
+ }
117
+ }
118
+ if (!contained)
119
+ this.constraints.push(constraint);
120
+ }
121
+ let attachments = skin.getAttachments();
122
+ for (let i = 0; i < attachments.length; i++) {
123
+ var attachment = attachments[i];
124
+ if (!attachment.attachment)
125
+ continue;
126
+ if (attachment.attachment instanceof MeshAttachment) {
127
+ attachment.attachment = attachment.attachment.newLinkedMesh();
128
+ this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);
129
+ }
130
+ else {
131
+ attachment.attachment = attachment.attachment.copy();
132
+ this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);
133
+ }
134
+ }
135
+ }
136
+ /** Returns the attachment for the specified slot index and name, or null. */
137
+ getAttachment(slotIndex, name) {
138
+ let dictionary = this.attachments[slotIndex];
139
+ return dictionary ? dictionary[name] : null;
140
+ }
141
+ /** Removes the attachment in the skin for the specified slot index and name, if any. */
142
+ removeAttachment(slotIndex, name) {
143
+ let dictionary = this.attachments[slotIndex];
144
+ if (dictionary)
145
+ delete dictionary[name];
146
+ }
147
+ /** Returns all attachments in this skin. */
148
+ getAttachments() {
149
+ let entries = new Array();
150
+ for (var i = 0; i < this.attachments.length; i++) {
151
+ let slotAttachments = this.attachments[i];
152
+ if (slotAttachments) {
153
+ for (let name in slotAttachments) {
154
+ let attachment = slotAttachments[name];
155
+ if (attachment)
156
+ entries.push(new SkinEntry(i, name, attachment));
157
+ }
158
+ }
159
+ }
160
+ return entries;
161
+ }
162
+ /** Returns all attachments in this skin for the specified slot index. */
163
+ getAttachmentsForSlot(slotIndex, attachments) {
164
+ let slotAttachments = this.attachments[slotIndex];
165
+ if (slotAttachments) {
166
+ for (let name in slotAttachments) {
167
+ let attachment = slotAttachments[name];
168
+ if (attachment)
169
+ attachments.push(new SkinEntry(slotIndex, name, attachment));
170
+ }
171
+ }
172
+ }
173
+ /** Clears all attachments, bones, and constraints. */
174
+ clear() {
175
+ this.attachments.length = 0;
176
+ this.bones.length = 0;
177
+ this.constraints.length = 0;
178
+ }
179
+ /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */
180
+ attachAll(skeleton, oldSkin) {
181
+ let slotIndex = 0;
182
+ for (let i = 0; i < skeleton.slots.length; i++) {
183
+ let slot = skeleton.slots[i];
184
+ let slotAttachment = slot.getAttachment();
185
+ if (slotAttachment && slotIndex < oldSkin.attachments.length) {
186
+ let dictionary = oldSkin.attachments[slotIndex];
187
+ for (let key in dictionary) {
188
+ let skinAttachment = dictionary[key];
189
+ if (slotAttachment == skinAttachment) {
190
+ let attachment = this.getAttachment(slotIndex, key);
191
+ if (attachment)
192
+ slot.setAttachment(attachment);
193
+ break;
194
+ }
195
+ }
196
+ }
197
+ slotIndex++;
198
+ }
199
+ }
200
+ }
201
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlI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SxjQUFjLEdBQWUsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDO29CQUNqRCxJQUFJLGNBQWMsSUFBSSxjQUFjLEVBQUU7d0JBQ3JDLElBQUksVUFBVSxHQUFHLElBQUksQ0FBQyxhQUFhLENBQUMsU0FBUyxFQUFFLEdBQUcsQ0FBQyxDQUFDO3dCQUNwRCxJQUFJLFVBQVU7NEJBQUUsSUFBSSxDQUFDLGFBQWEsQ0FBQyxVQUFVLENBQUMsQ0FBQzt3QkFDL0MsTUFBTTtxQkFDTjtpQkFDRDthQUNEO1lBQ0QsU0FBUyxFQUFFLENBQUM7U0FDWjtJQUNGLENBQUM7Q0FDRCJ9
package/dist/Slot.d.ts ADDED
@@ -0,0 +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 | null;
48
+ attachment: Attachment | null;
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 | null;
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 | null): void;
67
+ /** Sets this slot to the setup pose. */
68
+ setToSetupPose(): void;
69
+ }
package/dist/Slot.js ADDED
@@ -0,0 +1,93 @@
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 dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
37
+ * color's alpha is not used. */
38
+ this.darkColor = null;
39
+ this.attachment = null;
40
+ this.attachmentState = 0;
41
+ /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the
42
+ * {@link Sequence#getSetupIndex()}. */
43
+ this.sequenceIndex = -1;
44
+ /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
45
+ * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
46
+ *
47
+ * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
48
+ this.deform = new Array();
49
+ if (!data)
50
+ throw new Error("data cannot be null.");
51
+ if (!bone)
52
+ throw new Error("bone cannot be null.");
53
+ this.data = data;
54
+ this.bone = bone;
55
+ this.color = new Color();
56
+ this.darkColor = !data.darkColor ? null : new Color();
57
+ this.setToSetupPose();
58
+ }
59
+ /** The skeleton this slot belongs to. */
60
+ getSkeleton() {
61
+ return this.bone.skeleton;
62
+ }
63
+ /** The current attachment for the slot, or null if the slot has no attachment. */
64
+ getAttachment() {
65
+ return this.attachment;
66
+ }
67
+ /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.
68
+ * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the
69
+ * specified attachment. */
70
+ setAttachment(attachment) {
71
+ if (this.attachment == attachment)
72
+ return;
73
+ if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)
74
+ || attachment.timelineAttachment != this.attachment.timelineAttachment) {
75
+ this.deform.length = 0;
76
+ }
77
+ this.attachment = attachment;
78
+ this.sequenceIndex = -1;
79
+ }
80
+ /** Sets this slot to the setup pose. */
81
+ setToSetupPose() {
82
+ this.color.setFromColor(this.data.color);
83
+ if (this.darkColor)
84
+ this.darkColor.setFromColor(this.data.darkColor);
85
+ if (!this.data.attachmentName)
86
+ this.attachment = null;
87
+ else {
88
+ this.attachment = null;
89
+ this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));
90
+ }
91
+ }
92
+ }
93
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2xvdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9TbG90LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7K0VBMkIrRTtBQUUvRSxPQUFPLEVBQWMsZ0JBQWdCLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUl4RSxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBRWhDOztnQ0FFZ0M7QUFDaEMsTUFBTSxPQUFPLElBQUk7SUE2QmhCLFlBQWEsSUFBYyxFQUFFLElBQVU7UUFsQnZDO3dDQUNnQztRQUNoQyxjQUFTLEdBQWlCLElBQUksQ0FBQztRQUUvQixlQUFVLEdBQXNCLElBQUksQ0FBQztRQUVyQyxvQkFBZSxHQUFXLENBQUMsQ0FBQztRQUU1QjsrQ0FDdUM7UUFDdkMsa0JBQWEsR0FBVyxDQUFDLEN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QUFXLENBQUMsa0JBQWtCLEVBQUU7WUFDaEgsSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDO1NBQ3ZCO1FBQ0QsSUFBSSxDQUFDLFVBQVUsR0FBRyxVQUFVLENBQUM7UUFDN0IsSUFBSSxDQUFDLGFBQWEsR0FBRyxDQUFDLENBQUMsQ0FBQztJQUN6QixDQUFDO0lBRUQsd0NBQXdDO0lBQ3hDLGNBQWM7UUFDYixJQUFJLENBQUMsS0FBSyxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3pDLElBQUksSUFBSSxDQUFDLFNBQVM7WUFBRSxJQUFJLENBQUMsU0FBUyxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVUsQ0FBQyxDQUFDO1FBQ3RFLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLGNBQWM7WUFDNUIsSUFBSSxDQUFDLFVBQVUsR0FBRyxJQUFJLENBQUM7YUFDbkI7WUFDSixJQUFJLENBQUMsVUFBVSxHQUFHLElBQUksQ0FBQztZQUN2QixJQUFJLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLGNBQWMsQ0FBQyxDQUFDLENBQUM7U0FDaEc7SUFDRixDQUFDO0NBQ0QifQ==
@@ -0,0 +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 | 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
+ attachmentName: string | null;
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
+ }
@@ -0,0 +1,64 @@
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 color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
36
+ * color tinting. */
37
+ this.color = new Color(1, 1, 1, 1);
38
+ /** 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
39
+ * color's alpha is not used. */
40
+ this.darkColor = null;
41
+ /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
42
+ this.attachmentName = null;
43
+ /** The blend mode for drawing the slot's attachment. */
44
+ this.blendMode = BlendMode.Normal;
45
+ if (index < 0)
46
+ throw new Error("index must be >= 0.");
47
+ if (!name)
48
+ throw new Error("name cannot be null.");
49
+ if (!boneData)
50
+ throw new Error("boneData cannot be null.");
51
+ this.index = index;
52
+ this.name = name;
53
+ this.boneData = boneData;
54
+ }
55
+ }
56
+ /** Determines how images are blended with existing pixels when drawn. */
57
+ export var BlendMode;
58
+ (function (BlendMode) {
59
+ BlendMode[BlendMode["Normal"] = 0] = "Normal";
60
+ BlendMode[BlendMode["Additive"] = 1] = "Additive";
61
+ BlendMode[BlendMode["Multiply"] = 2] = "Multiply";
62
+ BlendMode[BlendMode["Screen"] = 3] = "Screen";
63
+ })(BlendMode || (BlendMode = {}));
64
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2xvdERhdGEuanMiLCJzb3VyY2VSb290Ij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FBRUQseUVBQXlFO0FBQ3pFLE1BQU0sQ0FBTixJQUFZLFNBQWdEO0FBQTVELFdBQVksU0FBUztJQUFHLDZDQUFNLENBQUE7SUFBRSxpREFBUSxDQUFBO0lBQUUsaURBQVEsQ0FBQTtJQUFFLDZDQUFNLENBQUE7QUFBQyxDQUFDLEVBQWhELFNBQVMsS0FBVCxTQUFTLFFBQXVDIn0=
@@ -0,0 +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
+ export declare abstract class Texture {
30
+ protected _image: HTMLImageElement | ImageBitmap;
31
+ constructor(image: HTMLImageElement | ImageBitmap);
32
+ getImage(): HTMLImageElement | ImageBitmap;
33
+ abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
34
+ abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
35
+ abstract dispose(): void;
36
+ }
37
+ export declare enum TextureFilter {
38
+ Nearest = 9728,
39
+ Linear = 9729,
40
+ MipMap = 9987,
41
+ MipMapNearestNearest = 9984,
42
+ MipMapLinearNearest = 9985,
43
+ MipMapNearestLinear = 9986,
44
+ MipMapLinearLinear = 9987
45
+ }
46
+ export declare enum TextureWrap {
47
+ MirroredRepeat = 33648,
48
+ ClampToEdge = 33071,
49
+ Repeat = 10497
50
+ }
51
+ export declare class TextureRegion {
52
+ renderObject: any;
53
+ u: number;
54
+ v: number;
55
+ u2: number;
56
+ v2: number;
57
+ width: number;
58
+ height: number;
59
+ degrees: number;
60
+ offsetX: number;
61
+ offsetY: number;
62
+ originalWidth: number;
63
+ originalHeight: number;
64
+ }
65
+ export declare class FakeTexture extends Texture {
66
+ setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
67
+ setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
68
+ dispose(): void;
69
+ }