@esotericsoftware/spine-core 4.0.11 → 4.0.15

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 (92) hide show
  1. package/dist/Animation.d.ts +363 -363
  2. package/dist/Animation.js +1949 -1949
  3. package/dist/AnimationState.d.ts +396 -396
  4. package/dist/AnimationState.js +958 -958
  5. package/dist/AnimationStateData.d.ts +51 -51
  6. package/dist/AnimationStateData.js +69 -69
  7. package/dist/AssetManagerBase.d.ts +72 -72
  8. package/dist/AssetManagerBase.js +303 -303
  9. package/dist/AtlasAttachmentLoader.d.ts +51 -51
  10. package/dist/AtlasAttachmentLoader.js +73 -73
  11. package/dist/Bone.d.ts +138 -138
  12. package/dist/Bone.js +333 -333
  13. package/dist/BoneData.d.ts +72 -72
  14. package/dist/BoneData.js +73 -73
  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 +41 -41
  19. package/dist/EventData.d.ts +41 -41
  20. package/dist/EventData.js +36 -36
  21. package/dist/IkConstraint.d.ts +64 -64
  22. package/dist/IkConstraint.js +284 -284
  23. package/dist/IkConstraintData.d.ts +54 -54
  24. package/dist/IkConstraintData.js +53 -53
  25. package/dist/PathConstraint.d.ts +71 -71
  26. package/dist/PathConstraint.js +468 -468
  27. package/dist/PathConstraintData.d.ts +80 -80
  28. package/dist/PathConstraintData.js +69 -69
  29. package/dist/Skeleton.d.ts +158 -158
  30. package/dist/Skeleton.js +570 -570
  31. package/dist/SkeletonBinary.d.ts +67 -67
  32. package/dist/SkeletonBinary.js +1093 -1093
  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 +166 -166
  39. package/dist/SkeletonJson.d.ts +51 -51
  40. package/dist/SkeletonJson.js +915 -915
  41. package/dist/Skin.d.ts +71 -71
  42. package/dist/Skin.js +200 -200
  43. package/dist/Slot.d.ts +72 -72
  44. package/dist/Slot.js +93 -93
  45. package/dist/SlotData.d.ts +57 -57
  46. package/dist/SlotData.js +54 -54
  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 +245 -245
  51. package/dist/TransformConstraint.d.ts +60 -60
  52. package/dist/TransformConstraint.js +239 -239
  53. package/dist/TransformConstraintData.d.ts +60 -60
  54. package/dist/TransformConstraintData.js +59 -59
  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 +71 -71
  64. package/dist/attachments/Attachment.js +139 -139
  65. package/dist/attachments/AttachmentLoader.d.ts +53 -53
  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 +47 -47
  71. package/dist/attachments/MeshAttachment.d.ts +74 -74
  72. package/dist/attachments/MeshAttachment.js +159 -159
  73. package/dist/attachments/PathAttachment.d.ts +47 -47
  74. package/dist/attachments/PathAttachment.js +56 -56
  75. package/dist/attachments/PointAttachment.d.ts +48 -48
  76. package/dist/attachments/PointAttachment.js +62 -62
  77. package/dist/attachments/RegionAttachment.d.ts +108 -108
  78. package/dist/attachments/RegionAttachment.js +196 -196
  79. package/dist/attachments/index.d.ts +8 -8
  80. package/dist/attachments/index.js +8 -8
  81. package/dist/iife/spine-core.js +3 -3
  82. package/dist/iife/spine-core.js.map +2 -2
  83. package/dist/iife/spine-core.min.js +1 -1
  84. package/dist/index.d.ts +42 -42
  85. package/dist/index.js +42 -42
  86. package/dist/polyfills.d.ts +29 -29
  87. package/dist/polyfills.js +38 -38
  88. package/dist/vertexeffects/JitterEffect.d.ts +39 -39
  89. package/dist/vertexeffects/JitterEffect.js +45 -45
  90. package/dist/vertexeffects/SwirlEffect.d.ts +44 -44
  91. package/dist/vertexeffects/SwirlEffect.js +60 -60
  92. package/package.json +32 -32
@@ -1,74 +1,74 @@
1
- /******************************************************************************
2
- * Spine Runtimes License Agreement
3
- * Last updated January 1, 2020. Replaces all prior versions.
4
- *
5
- * Copyright (c) 2013-2020, 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 { TextureRegion } from "../Texture";
30
- import { Color, NumberArrayLike } from "../Utils";
31
- import { VertexAttachment, Attachment } from "./Attachment";
32
- /** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not
33
- * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.
34
- *
35
- * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */
36
- export declare class MeshAttachment extends VertexAttachment {
37
- region: TextureRegion;
38
- /** The name of the texture region for this attachment. */
39
- path: string;
40
- /** The UV pair for each vertex, normalized within the texture region. */
41
- regionUVs: NumberArrayLike;
42
- /** The UV pair for each vertex, normalized within the entire texture.
43
- *
44
- * See {@link #updateUVs}. */
45
- uvs: NumberArrayLike;
46
- /** Triplets of vertex indices which describe the mesh's triangulation. */
47
- triangles: Array<number>;
48
- /** The color to tint the mesh. */
49
- color: Color;
50
- /** The width of the mesh's image. Available only when nonessential data was exported. */
51
- width: number;
52
- /** The height of the mesh's image. Available only when nonessential data was exported. */
53
- height: number;
54
- /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */
55
- hullLength: number;
56
- /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if
57
- * nonessential data was exported. Triangulation is not performed at runtime. */
58
- edges: Array<number>;
59
- private parentMesh;
60
- tempColor: Color;
61
- constructor(name: string);
62
- /** Calculates {@link #uvs} using {@link #regionUVs} and the {@link #region}. Must be called after changing the region UVs or
63
- * region. */
64
- updateUVs(): void;
65
- /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},
66
- * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the
67
- * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */
68
- getParentMesh(): MeshAttachment;
69
- /** @param parentMesh May be null. */
70
- setParentMesh(parentMesh: MeshAttachment): void;
71
- copy(): Attachment;
72
- /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/
73
- newLinkedMesh(): MeshAttachment;
74
- }
1
+ /******************************************************************************
2
+ * Spine Runtimes License Agreement
3
+ * Last updated January 1, 2020. Replaces all prior versions.
4
+ *
5
+ * Copyright (c) 2013-2020, 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 { TextureRegion } from "../Texture";
30
+ import { Color, NumberArrayLike } from "../Utils";
31
+ import { VertexAttachment, Attachment } from "./Attachment";
32
+ /** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not
33
+ * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.
34
+ *
35
+ * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */
36
+ export declare class MeshAttachment extends VertexAttachment {
37
+ region: TextureRegion;
38
+ /** The name of the texture region for this attachment. */
39
+ path: string;
40
+ /** The UV pair for each vertex, normalized within the texture region. */
41
+ regionUVs: NumberArrayLike;
42
+ /** The UV pair for each vertex, normalized within the entire texture.
43
+ *
44
+ * See {@link #updateUVs}. */
45
+ uvs: NumberArrayLike;
46
+ /** Triplets of vertex indices which describe the mesh's triangulation. */
47
+ triangles: Array<number>;
48
+ /** The color to tint the mesh. */
49
+ color: Color;
50
+ /** The width of the mesh's image. Available only when nonessential data was exported. */
51
+ width: number;
52
+ /** The height of the mesh's image. Available only when nonessential data was exported. */
53
+ height: number;
54
+ /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */
55
+ hullLength: number;
56
+ /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if
57
+ * nonessential data was exported. Triangulation is not performed at runtime. */
58
+ edges: Array<number>;
59
+ private parentMesh;
60
+ tempColor: Color;
61
+ constructor(name: string);
62
+ /** Calculates {@link #uvs} using {@link #regionUVs} and the {@link #region}. Must be called after changing the region UVs or
63
+ * region. */
64
+ updateUVs(): void;
65
+ /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},
66
+ * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the
67
+ * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */
68
+ getParentMesh(): MeshAttachment;
69
+ /** @param parentMesh May be null. */
70
+ setParentMesh(parentMesh: MeshAttachment): void;
71
+ copy(): Attachment;
72
+ /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/
73
+ newLinkedMesh(): MeshAttachment;
74
+ }
@@ -1,160 +1,160 @@
1
- /******************************************************************************
2
- * Spine Runtimes License Agreement
3
- * Last updated January 1, 2020. Replaces all prior versions.
4
- *
5
- * Copyright (c) 2013-2020, 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 { TextureAtlasRegion } from "../TextureAtlas";
30
- import { Color, Utils } from "../Utils";
31
- import { VertexAttachment } from "./Attachment";
32
- /** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not
33
- * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.
34
- *
35
- * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */
36
- export class MeshAttachment extends VertexAttachment {
37
- constructor(name) {
38
- super(name);
39
- /** The color to tint the mesh. */
40
- this.color = new Color(1, 1, 1, 1);
41
- this.tempColor = new Color(0, 0, 0, 0);
42
- }
43
- /** Calculates {@link #uvs} using {@link #regionUVs} and the {@link #region}. Must be called after changing the region UVs or
44
- * region. */
45
- updateUVs() {
46
- let regionUVs = this.regionUVs;
47
- if (!this.uvs || this.uvs.length != regionUVs.length)
48
- this.uvs = Utils.newFloatArray(regionUVs.length);
49
- let uvs = this.uvs;
50
- let n = this.uvs.length;
51
- let u = this.region.u, v = this.region.v, width = 0, height = 0;
52
- if (this.region instanceof TextureAtlasRegion) {
53
- let region = this.region, image = region.page.texture.getImage();
54
- let textureWidth = image.width, textureHeight = image.height;
55
- switch (region.degrees) {
56
- case 90:
57
- u -= (region.originalHeight - region.offsetY - region.height) / textureWidth;
58
- v -= (region.originalWidth - region.offsetX - region.width) / textureHeight;
59
- width = region.originalHeight / textureWidth;
60
- height = region.originalWidth / textureHeight;
61
- for (let i = 0; i < n; i += 2) {
62
- uvs[i] = u + regionUVs[i + 1] * width;
63
- uvs[i + 1] = v + (1 - regionUVs[i]) * height;
64
- }
65
- return;
66
- case 180:
67
- u -= (region.originalWidth - region.offsetX - region.width) / textureWidth;
68
- v -= region.offsetY / textureHeight;
69
- width = region.originalWidth / textureWidth;
70
- height = region.originalHeight / textureHeight;
71
- for (let i = 0; i < n; i += 2) {
72
- uvs[i] = u + (1 - regionUVs[i]) * width;
73
- uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;
74
- }
75
- return;
76
- case 270:
77
- u -= region.offsetY / textureWidth;
78
- v -= region.offsetX / textureHeight;
79
- width = region.originalHeight / textureWidth;
80
- height = region.originalWidth / textureHeight;
81
- for (let i = 0; i < n; i += 2) {
82
- uvs[i] = u + (1 - regionUVs[i + 1]) * width;
83
- uvs[i + 1] = v + regionUVs[i] * height;
84
- }
85
- return;
86
- }
87
- u -= region.offsetX / textureWidth;
88
- v -= (region.originalHeight - region.offsetY - region.height) / textureHeight;
89
- width = region.originalWidth / textureWidth;
90
- height = region.originalHeight / textureHeight;
91
- }
92
- else if (!this.region) {
93
- u = v = 0;
94
- width = height = 1;
95
- }
96
- else {
97
- width = this.region.u2 - u;
98
- height = this.region.v2 - v;
99
- }
100
- for (let i = 0; i < n; i += 2) {
101
- uvs[i] = u + regionUVs[i] * width;
102
- uvs[i + 1] = v + regionUVs[i + 1] * height;
103
- }
104
- }
105
- /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},
106
- * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the
107
- * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */
108
- getParentMesh() {
109
- return this.parentMesh;
110
- }
111
- /** @param parentMesh May be null. */
112
- setParentMesh(parentMesh) {
113
- this.parentMesh = parentMesh;
114
- if (parentMesh) {
115
- this.bones = parentMesh.bones;
116
- this.vertices = parentMesh.vertices;
117
- this.worldVerticesLength = parentMesh.worldVerticesLength;
118
- this.regionUVs = parentMesh.regionUVs;
119
- this.triangles = parentMesh.triangles;
120
- this.hullLength = parentMesh.hullLength;
121
- this.worldVerticesLength = parentMesh.worldVerticesLength;
122
- }
123
- }
124
- copy() {
125
- if (this.parentMesh)
126
- return this.newLinkedMesh();
127
- let copy = new MeshAttachment(this.name);
128
- copy.region = this.region;
129
- copy.path = this.path;
130
- copy.color.setFromColor(this.color);
131
- this.copyTo(copy);
132
- copy.regionUVs = new Array(this.regionUVs.length);
133
- Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);
134
- copy.uvs = new Array(this.uvs.length);
135
- Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);
136
- copy.triangles = new Array(this.triangles.length);
137
- Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);
138
- copy.hullLength = this.hullLength;
139
- // Nonessential.
140
- if (this.edges) {
141
- copy.edges = new Array(this.edges.length);
142
- Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);
143
- }
144
- copy.width = this.width;
145
- copy.height = this.height;
146
- return copy;
147
- }
148
- /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/
149
- newLinkedMesh() {
150
- let copy = new MeshAttachment(this.name);
151
- copy.region = this.region;
152
- copy.path = this.path;
153
- copy.color.setFromColor(this.color);
154
- copy.deformAttachment = this.deformAttachment;
155
- copy.setParentMesh(this.parentMesh ? this.parentMesh : this);
156
- copy.updateUVs();
157
- return copy;
158
- }
159
- }
1
+ /******************************************************************************
2
+ * Spine Runtimes License Agreement
3
+ * Last updated January 1, 2020. Replaces all prior versions.
4
+ *
5
+ * Copyright (c) 2013-2020, 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 { TextureAtlasRegion } from "../TextureAtlas";
30
+ import { Color, Utils } from "../Utils";
31
+ import { VertexAttachment } from "./Attachment";
32
+ /** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not
33
+ * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.
34
+ *
35
+ * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */
36
+ export class MeshAttachment extends VertexAttachment {
37
+ constructor(name) {
38
+ super(name);
39
+ /** The color to tint the mesh. */
40
+ this.color = new Color(1, 1, 1, 1);
41
+ this.tempColor = new Color(0, 0, 0, 0);
42
+ }
43
+ /** Calculates {@link #uvs} using {@link #regionUVs} and the {@link #region}. Must be called after changing the region UVs or
44
+ * region. */
45
+ updateUVs() {
46
+ let regionUVs = this.regionUVs;
47
+ if (!this.uvs || this.uvs.length != regionUVs.length)
48
+ this.uvs = Utils.newFloatArray(regionUVs.length);
49
+ let uvs = this.uvs;
50
+ let n = this.uvs.length;
51
+ let u = this.region.u, v = this.region.v, width = 0, height = 0;
52
+ if (this.region instanceof TextureAtlasRegion) {
53
+ let region = this.region, image = region.page.texture.getImage();
54
+ let textureWidth = image.width, textureHeight = image.height;
55
+ switch (region.degrees) {
56
+ case 90:
57
+ u -= (region.originalHeight - region.offsetY - region.height) / textureWidth;
58
+ v -= (region.originalWidth - region.offsetX - region.width) / textureHeight;
59
+ width = region.originalHeight / textureWidth;
60
+ height = region.originalWidth / textureHeight;
61
+ for (let i = 0; i < n; i += 2) {
62
+ uvs[i] = u + regionUVs[i + 1] * width;
63
+ uvs[i + 1] = v + (1 - regionUVs[i]) * height;
64
+ }
65
+ return;
66
+ case 180:
67
+ u -= (region.originalWidth - region.offsetX - region.width) / textureWidth;
68
+ v -= region.offsetY / textureHeight;
69
+ width = region.originalWidth / textureWidth;
70
+ height = region.originalHeight / textureHeight;
71
+ for (let i = 0; i < n; i += 2) {
72
+ uvs[i] = u + (1 - regionUVs[i]) * width;
73
+ uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;
74
+ }
75
+ return;
76
+ case 270:
77
+ u -= region.offsetY / textureWidth;
78
+ v -= region.offsetX / textureHeight;
79
+ width = region.originalHeight / textureWidth;
80
+ height = region.originalWidth / textureHeight;
81
+ for (let i = 0; i < n; i += 2) {
82
+ uvs[i] = u + (1 - regionUVs[i + 1]) * width;
83
+ uvs[i + 1] = v + regionUVs[i] * height;
84
+ }
85
+ return;
86
+ }
87
+ u -= region.offsetX / textureWidth;
88
+ v -= (region.originalHeight - region.offsetY - region.height) / textureHeight;
89
+ width = region.originalWidth / textureWidth;
90
+ height = region.originalHeight / textureHeight;
91
+ }
92
+ else if (!this.region) {
93
+ u = v = 0;
94
+ width = height = 1;
95
+ }
96
+ else {
97
+ width = this.region.u2 - u;
98
+ height = this.region.v2 - v;
99
+ }
100
+ for (let i = 0; i < n; i += 2) {
101
+ uvs[i] = u + regionUVs[i] * width;
102
+ uvs[i + 1] = v + regionUVs[i + 1] * height;
103
+ }
104
+ }
105
+ /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},
106
+ * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the
107
+ * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */
108
+ getParentMesh() {
109
+ return this.parentMesh;
110
+ }
111
+ /** @param parentMesh May be null. */
112
+ setParentMesh(parentMesh) {
113
+ this.parentMesh = parentMesh;
114
+ if (parentMesh) {
115
+ this.bones = parentMesh.bones;
116
+ this.vertices = parentMesh.vertices;
117
+ this.worldVerticesLength = parentMesh.worldVerticesLength;
118
+ this.regionUVs = parentMesh.regionUVs;
119
+ this.triangles = parentMesh.triangles;
120
+ this.hullLength = parentMesh.hullLength;
121
+ this.worldVerticesLength = parentMesh.worldVerticesLength;
122
+ }
123
+ }
124
+ copy() {
125
+ if (this.parentMesh)
126
+ return this.newLinkedMesh();
127
+ let copy = new MeshAttachment(this.name);
128
+ copy.region = this.region;
129
+ copy.path = this.path;
130
+ copy.color.setFromColor(this.color);
131
+ this.copyTo(copy);
132
+ copy.regionUVs = new Array(this.regionUVs.length);
133
+ Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);
134
+ copy.uvs = new Array(this.uvs.length);
135
+ Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);
136
+ copy.triangles = new Array(this.triangles.length);
137
+ Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);
138
+ copy.hullLength = this.hullLength;
139
+ // Nonessential.
140
+ if (this.edges) {
141
+ copy.edges = new Array(this.edges.length);
142
+ Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);
143
+ }
144
+ copy.width = this.width;
145
+ copy.height = this.height;
146
+ return copy;
147
+ }
148
+ /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/
149
+ newLinkedMesh() {
150
+ let copy = new MeshAttachment(this.name);
151
+ copy.region = this.region;
152
+ copy.path = this.path;
153
+ copy.color.setFromColor(this.color);
154
+ copy.deformAttachment = this.deformAttachment;
155
+ copy.setParentMesh(this.parentMesh ? this.parentMesh : this);
156
+ copy.updateUVs();
157
+ return copy;
158
+ }
159
+ }
160
160
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWVzaEF0dGFjaG1lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXR0YWNobWVudHMvTWVzaEF0dGFjaG1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsrRUEyQitFO0FBRy9FLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ3JELE9BQU8sRUFBRSxLQUFLLEVBQW1CLEtBQUssRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUN6RCxPQUFPLEVBQUUsZ0JBQWdCLEVBQWMsTUFBTSxjQUFjLENBQUM7QUFFNUQ7OzsrRkFHK0Y7QUFDL0YsTUFBTSxPQUFPLGNBQWUsU0FBUSxnQkFBZ0I7SUFvQ25ELFlBQWEsSUFBWTtRQUN4QixLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7UUFwQmIsa0NBQWtDO1FBQ2xDLFVBQUssR0FBRyxJQUFJLEtBQUssQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztRQWdCOUIsY0FBUyxHQUFHLElBQUksS0FBSyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENB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EVBQUUsQ0FBQyxFQUFFLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQyxFQUFFLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7U0FDakU7UUFDRCxJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUM7UUFDeEIsSUFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO1FBRTFCLE9BQU8sSUFBSSxDQUFDO0lBQ2IsQ0FBQztJQUVELGtIQUFrSDtJQUNsSCxhQUFhO1FBQ1osSUFBSSxJQUFJLEdBQUcsSUFBSSxjQUFjLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQ3pDLElBQUksQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQztRQUMxQixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUM7UUFDdEIsSUFBSSxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3BDLElBQUksQ0FBQyxnQkFBZ0IsR0FBRyxJQUFJLENBQUMsZ0JBQWdCLENBQUM7UUFDOUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUM3RCxJQUFJLENBQUMsU0FBUyxFQUFFLENBQUM7UUFDakIsT0FBTyxJQUFJLENBQUM7SUFDYixDQUFDO0NBQ0QifQ==
@@ -1,47 +1,47 @@
1
- /******************************************************************************
2
- * Spine Runtimes License Agreement
3
- * Last updated January 1, 2020. Replaces all prior versions.
4
- *
5
- * Copyright (c) 2013-2020, 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
- import { VertexAttachment, Attachment } from "./Attachment";
31
- /** An attachment whose vertices make up a composite Bezier curve.
32
- *
33
- * See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */
34
- export declare class PathAttachment extends VertexAttachment {
35
- /** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */
36
- lengths: Array<number>;
37
- /** If true, the start and end knots are connected. */
38
- closed: boolean;
39
- /** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer
40
- * calculations are performed but calculating positions along the path is less accurate. */
41
- constantSpeed: boolean;
42
- /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually
43
- * rendered at runtime. */
44
- color: Color;
45
- constructor(name: string);
46
- copy(): Attachment;
47
- }
1
+ /******************************************************************************
2
+ * Spine Runtimes License Agreement
3
+ * Last updated January 1, 2020. Replaces all prior versions.
4
+ *
5
+ * Copyright (c) 2013-2020, 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
+ import { VertexAttachment, Attachment } from "./Attachment";
31
+ /** An attachment whose vertices make up a composite Bezier curve.
32
+ *
33
+ * See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */
34
+ export declare class PathAttachment extends VertexAttachment {
35
+ /** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */
36
+ lengths: Array<number>;
37
+ /** If true, the start and end knots are connected. */
38
+ closed: boolean;
39
+ /** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer
40
+ * calculations are performed but calculating positions along the path is less accurate. */
41
+ constantSpeed: boolean;
42
+ /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually
43
+ * rendered at runtime. */
44
+ color: Color;
45
+ constructor(name: string);
46
+ copy(): Attachment;
47
+ }