@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
@@ -1,53 +1,53 @@
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 { AttachmentLoader } from "./attachments/AttachmentLoader";
30
- import { BoundingBoxAttachment } from "./attachments/BoundingBoxAttachment";
31
- import { ClippingAttachment } from "./attachments/ClippingAttachment";
32
- import { MeshAttachment } from "./attachments/MeshAttachment";
33
- import { PathAttachment } from "./attachments/PathAttachment";
34
- import { PointAttachment } from "./attachments/PointAttachment";
35
- import { RegionAttachment } from "./attachments/RegionAttachment";
36
- import { Skin } from "./Skin";
37
- import { TextureAtlas } from "./TextureAtlas";
38
- import { Sequence } from "./attachments/Sequence";
39
- /** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.
40
- *
41
- * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the
42
- * Spine Runtimes Guide. */
43
- export declare class AtlasAttachmentLoader implements AttachmentLoader {
44
- atlas: TextureAtlas;
45
- constructor(atlas: TextureAtlas);
46
- loadSequence(name: string, basePath: string, sequence: Sequence): void;
47
- newRegionAttachment(skin: Skin, name: string, path: string, sequence: Sequence): RegionAttachment;
48
- newMeshAttachment(skin: Skin, name: string, path: string, sequence: Sequence): MeshAttachment;
49
- newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
50
- newPathAttachment(skin: Skin, name: string): PathAttachment;
51
- newPointAttachment(skin: Skin, name: string): PointAttachment;
52
- newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
53
- }
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 { AttachmentLoader } from "./attachments/AttachmentLoader";
30
+ import { BoundingBoxAttachment } from "./attachments/BoundingBoxAttachment";
31
+ import { ClippingAttachment } from "./attachments/ClippingAttachment";
32
+ import { MeshAttachment } from "./attachments/MeshAttachment";
33
+ import { PathAttachment } from "./attachments/PathAttachment";
34
+ import { PointAttachment } from "./attachments/PointAttachment";
35
+ import { RegionAttachment } from "./attachments/RegionAttachment";
36
+ import { Skin } from "./Skin";
37
+ import { TextureAtlas } from "./TextureAtlas";
38
+ import { Sequence } from "./attachments/Sequence";
39
+ /** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.
40
+ *
41
+ * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the
42
+ * Spine Runtimes Guide. */
43
+ export declare class AtlasAttachmentLoader implements AttachmentLoader {
44
+ atlas: TextureAtlas;
45
+ constructor(atlas: TextureAtlas);
46
+ loadSequence(name: string, basePath: string, sequence: Sequence): void;
47
+ newRegionAttachment(skin: Skin, name: string, path: string, sequence: Sequence): RegionAttachment;
48
+ newMeshAttachment(skin: Skin, name: string, path: string, sequence: Sequence): MeshAttachment;
49
+ newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
50
+ newPathAttachment(skin: Skin, name: string): PathAttachment;
51
+ newPointAttachment(skin: Skin, name: string): PointAttachment;
52
+ newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
53
+ }
@@ -1,94 +1,95 @@
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 { BoundingBoxAttachment } from "./attachments/BoundingBoxAttachment";
30
- import { ClippingAttachment } from "./attachments/ClippingAttachment";
31
- import { MeshAttachment } from "./attachments/MeshAttachment";
32
- import { PathAttachment } from "./attachments/PathAttachment";
33
- import { PointAttachment } from "./attachments/PointAttachment";
34
- import { RegionAttachment } from "./attachments/RegionAttachment";
35
- /** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.
36
- *
37
- * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the
38
- * Spine Runtimes Guide. */
39
- export class AtlasAttachmentLoader {
40
- constructor(atlas) {
41
- this.atlas = atlas;
42
- }
43
- loadSequence(name, basePath, sequence) {
44
- let regions = sequence.regions;
45
- for (let i = 0, n = regions.length; i < n; i++) {
46
- let path = sequence.getPath(basePath, i);
47
- regions[i] = this.atlas.findRegion(path);
48
- regions[i].renderObject = regions[i];
49
- if (regions[i] == null)
50
- throw new Error("Region not found in atlas: " + path + " (sequence: " + name + ")");
51
- }
52
- }
53
- newRegionAttachment(skin, name, path, sequence) {
54
- let attachment = new RegionAttachment(name);
55
- if (sequence != null) {
56
- this.loadSequence(name, path, sequence);
57
- }
58
- else {
59
- let region = this.atlas.findRegion(path);
60
- if (!region)
61
- throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
62
- region.renderObject = region;
63
- attachment.region = region;
64
- }
65
- return attachment;
66
- }
67
- newMeshAttachment(skin, name, path, sequence) {
68
- let attachment = new MeshAttachment(name);
69
- if (sequence != null) {
70
- this.loadSequence(name, path, sequence);
71
- }
72
- else {
73
- let region = this.atlas.findRegion(path);
74
- if (!region)
75
- throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
76
- region.renderObject = region;
77
- attachment.region = region;
78
- }
79
- return attachment;
80
- }
81
- newBoundingBoxAttachment(skin, name) {
82
- return new BoundingBoxAttachment(name);
83
- }
84
- newPathAttachment(skin, name) {
85
- return new PathAttachment(name);
86
- }
87
- newPointAttachment(skin, name) {
88
- return new PointAttachment(name);
89
- }
90
- newClippingAttachment(skin, name) {
91
- return new ClippingAttachment(name);
92
- }
93
- }
94
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXRsYXNBdHRhY2htZW50TG9hZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0F0bGFzQXR0YWNobWVudExvYWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OytFQTJCK0U7QUFHL0UsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFDNUUsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFDdEUsT0F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SxDQUFDLE1BQU07Z0JBQUUsTUFBTSxJQUFJLEtBQUssQ0FBQyw2QkFBNkIsR0FBRyxJQUFJLEdBQUcscUJBQXFCLEdBQUcsSUFBSSxHQUFHLEdBQUcsQ0FBQyxDQUFDO1lBQ3hHLE1BQU0sQ0FBQyxZQUFZLEdBQUcsTUFBTSxDQUFDO1lBQzdCLFVBQVUsQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO1NBQzNCO1FBQ0QsT0FBTyxVQUFVLENBQUM7SUFDbkIsQ0FBQztJQUVELHdCQUF3QixDQUFFLElBQVUsRUFBRSxJQUFZO1FBQ2pELE9BQU8sSUFBSSxxQkFBcUIsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUN4QyxDQUFDO0lBRUQsaUJBQWlCLENBQUUsSUFBVSxFQUFFLElBQVk7UUFDMUMsT0FBTyxJQUFJLGNBQWMsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNqQyxDQUFDO0lBRUQsa0JBQWtCLENBQUUsSUFBVSxFQUFFLElBQVk7UUFDM0MsT0FBTyxJQUFJLGVBQWUsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNsQyxDQUFDO0lBRUQscUJBQXFCLENBQUUsSUFBVSxFQUFFLElBQVk7UUFDOUMsT0FBTyxJQUFJLGtCQUFrQixDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3JDLENBQUM7Q0FDRCJ9
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 { BoundingBoxAttachment } from "./attachments/BoundingBoxAttachment";
30
+ import { ClippingAttachment } from "./attachments/ClippingAttachment";
31
+ import { MeshAttachment } from "./attachments/MeshAttachment";
32
+ import { PathAttachment } from "./attachments/PathAttachment";
33
+ import { PointAttachment } from "./attachments/PointAttachment";
34
+ import { RegionAttachment } from "./attachments/RegionAttachment";
35
+ /** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.
36
+ *
37
+ * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the
38
+ * Spine Runtimes Guide. */
39
+ export class AtlasAttachmentLoader {
40
+ constructor(atlas) {
41
+ this.atlas = null;
42
+ this.atlas = atlas;
43
+ }
44
+ loadSequence(name, basePath, sequence) {
45
+ let regions = sequence.regions;
46
+ for (let i = 0, n = regions.length; i < n; i++) {
47
+ let path = sequence.getPath(basePath, i);
48
+ regions[i] = this.atlas.findRegion(path);
49
+ regions[i].renderObject = regions[i];
50
+ if (regions[i] == null)
51
+ throw new Error("Region not found in atlas: " + path + " (sequence: " + name + ")");
52
+ }
53
+ }
54
+ newRegionAttachment(skin, name, path, sequence) {
55
+ let attachment = new RegionAttachment(name);
56
+ if (sequence != null) {
57
+ this.loadSequence(name, path, sequence);
58
+ }
59
+ else {
60
+ let region = this.atlas.findRegion(path);
61
+ if (!region)
62
+ throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
63
+ region.renderObject = region;
64
+ attachment.region = region;
65
+ }
66
+ return attachment;
67
+ }
68
+ newMeshAttachment(skin, name, path, sequence) {
69
+ let attachment = new MeshAttachment(name);
70
+ if (sequence != null) {
71
+ this.loadSequence(name, path, sequence);
72
+ }
73
+ else {
74
+ let region = this.atlas.findRegion(path);
75
+ if (!region)
76
+ throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
77
+ region.renderObject = region;
78
+ attachment.region = region;
79
+ }
80
+ return attachment;
81
+ }
82
+ newBoundingBoxAttachment(skin, name) {
83
+ return new BoundingBoxAttachment(name);
84
+ }
85
+ newPathAttachment(skin, name) {
86
+ return new PathAttachment(name);
87
+ }
88
+ newPointAttachment(skin, name) {
89
+ return new PointAttachment(name);
90
+ }
91
+ newClippingAttachment(skin, name) {
92
+ return new ClippingAttachment(name);
93
+ }
94
+ }
95
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXRsYXNBdHRhY2htZW50TG9hZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0F0bGFzQXR0YWNobWVudExvYWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7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FO1lBQ3JCLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxFQUFFLElBQUksRUFBRSxRQUFRLENBQUMsQ0FBQztTQUN4QzthQUFNO1lBQ04sSUFBSSxNQUFNLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLENBQUM7WUFDekMsSUFBSSxDQUFDLE1BQU07Z0JBQUUsTUFBTSxJQUFJLEtBQUssQ0FBQyw2QkFBNkIsR0FBRyxJQUFJLEdBQUcscUJBQXFCLEdBQUcsSUFBSSxHQUFHLEdBQUcsQ0FBQyxDQUFDO1lBQ3hHLE1BQU0sQ0FBQyxZQUFZLEdBQUcsTUFBTSxDQUFDO1lBQzdCLFVBQVUsQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO1NBQzNCO1FBQ0QsT0FBTyxVQUFVLENBQUM7SUFDbkIsQ0FBQztJQUVELHdCQUF3QixDQUFFLElBQVUsRUFBRSxJQUFZO1FBQ2pELE9BQU8sSUFBSSxxQkFBcUIsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUN4QyxDQUFDO0lBRUQsaUJBQWlCLENBQUUsSUFBVSxFQUFFLElBQVk7UUFDMUMsT0FBTyxJQUFJLGNBQWMsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNqQyxDQUFDO0lBRUQsa0JBQWtCLENBQUUsSUFBVSxFQUFFLElBQVk7UUFDM0MsT0FBTyxJQUFJLGVBQWUsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNsQyxDQUFDO0lBRUQscUJBQXFCLENBQUUsSUFBVSxFQUFFLElBQVk7UUFDOUMsT0FBTyxJQUFJLGtCQUFrQixDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3JDLENBQUM7Q0FDRCJ9
package/dist/Bone.d.ts CHANGED
@@ -1,138 +1,138 @@
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 { Skeleton } from "./Skeleton";
31
- import { Updatable } from "./Updatable";
32
- import { Vector2 } from "./Utils";
33
- /** Stores a bone's current pose.
34
- *
35
- * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
36
- * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
37
- * constraint or application code modifies the world transform after it was computed from the local transform. */
38
- export declare class Bone implements Updatable {
39
- /** The bone's setup pose data. */
40
- data: BoneData;
41
- /** The skeleton this bone belongs to. */
42
- skeleton: Skeleton;
43
- /** The parent bone, or null if this is the root bone. */
44
- parent: Bone;
45
- /** The immediate children of this bone. */
46
- children: Bone[];
47
- /** The local x translation. */
48
- x: number;
49
- /** The local y translation. */
50
- y: number;
51
- /** The local rotation in degrees, counter clockwise. */
52
- rotation: number;
53
- /** The local scaleX. */
54
- scaleX: number;
55
- /** The local scaleY. */
56
- scaleY: number;
57
- /** The local shearX. */
58
- shearX: number;
59
- /** The local shearY. */
60
- shearY: number;
61
- /** The applied local x translation. */
62
- ax: number;
63
- /** The applied local y translation. */
64
- ay: number;
65
- /** The applied local rotation in degrees, counter clockwise. */
66
- arotation: number;
67
- /** The applied local scaleX. */
68
- ascaleX: number;
69
- /** The applied local scaleY. */
70
- ascaleY: number;
71
- /** The applied local shearX. */
72
- ashearX: number;
73
- /** The applied local shearY. */
74
- ashearY: number;
75
- /** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */
76
- a: number;
77
- /** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */
78
- b: number;
79
- /** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */
80
- c: number;
81
- /** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */
82
- d: number;
83
- /** The world X position. If changed, {@link #updateAppliedTransform()} should be called. */
84
- worldY: number;
85
- /** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */
86
- worldX: number;
87
- sorted: boolean;
88
- active: boolean;
89
- /** @param parent May be null. */
90
- constructor(data: BoneData, skeleton: Skeleton, parent: Bone);
91
- /** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the
92
- * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */
93
- isActive(): boolean;
94
- /** Computes the world transform using the parent bone and this bone's local applied transform. */
95
- update(): void;
96
- /** Computes the world transform using the parent bone and this bone's local transform.
97
- *
98
- * See {@link #updateWorldTransformWith()}. */
99
- updateWorldTransform(): void;
100
- /** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the
101
- * specified local transform. Child bones are not updated.
102
- *
103
- * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine
104
- * Runtimes Guide. */
105
- updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void;
106
- /** Sets this bone's local transform to the setup pose. */
107
- setToSetupPose(): void;
108
- /** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */
109
- getWorldRotationX(): number;
110
- /** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */
111
- getWorldRotationY(): number;
112
- /** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */
113
- getWorldScaleX(): number;
114
- /** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */
115
- getWorldScaleY(): number;
116
- /** Computes the applied transform values from the world transform.
117
- *
118
- * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so
119
- * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other
120
- * constraints).
121
- *
122
- * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after
123
- * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */
124
- updateAppliedTransform(): void;
125
- /** Transforms a point from world coordinates to the bone's local coordinates. */
126
- worldToLocal(world: Vector2): Vector2;
127
- /** Transforms a point from the bone's local coordinates to world coordinates. */
128
- localToWorld(local: Vector2): Vector2;
129
- /** Transforms a world rotation to a local rotation. */
130
- worldToLocalRotation(worldRotation: number): number;
131
- /** Transforms a local rotation to a world rotation. */
132
- localToWorldRotation(localRotation: number): number;
133
- /** Rotates the world transform the specified amount.
134
- * <p>
135
- * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and {@link #update()} will
136
- * need to be called on any child bones, recursively. */
137
- rotateWorld(degrees: number): void;
138
- }
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 { Skeleton } from "./Skeleton";
31
+ import { Updatable } from "./Updatable";
32
+ import { Vector2 } from "./Utils";
33
+ /** Stores a bone's current pose.
34
+ *
35
+ * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
36
+ * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
37
+ * constraint or application code modifies the world transform after it was computed from the local transform. */
38
+ export declare class Bone implements Updatable {
39
+ /** The bone's setup pose data. */
40
+ data: BoneData;
41
+ /** The skeleton this bone belongs to. */
42
+ skeleton: Skeleton;
43
+ /** The parent bone, or null if this is the root bone. */
44
+ parent: Bone;
45
+ /** The immediate children of this bone. */
46
+ children: Bone[];
47
+ /** The local x translation. */
48
+ x: number;
49
+ /** The local y translation. */
50
+ y: number;
51
+ /** The local rotation in degrees, counter clockwise. */
52
+ rotation: number;
53
+ /** The local scaleX. */
54
+ scaleX: number;
55
+ /** The local scaleY. */
56
+ scaleY: number;
57
+ /** The local shearX. */
58
+ shearX: number;
59
+ /** The local shearY. */
60
+ shearY: number;
61
+ /** The applied local x translation. */
62
+ ax: number;
63
+ /** The applied local y translation. */
64
+ ay: number;
65
+ /** The applied local rotation in degrees, counter clockwise. */
66
+ arotation: number;
67
+ /** The applied local scaleX. */
68
+ ascaleX: number;
69
+ /** The applied local scaleY. */
70
+ ascaleY: number;
71
+ /** The applied local shearX. */
72
+ ashearX: number;
73
+ /** The applied local shearY. */
74
+ ashearY: number;
75
+ /** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */
76
+ a: number;
77
+ /** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */
78
+ b: number;
79
+ /** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */
80
+ c: number;
81
+ /** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */
82
+ d: number;
83
+ /** The world X position. If changed, {@link #updateAppliedTransform()} should be called. */
84
+ worldY: number;
85
+ /** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */
86
+ worldX: number;
87
+ sorted: boolean;
88
+ active: boolean;
89
+ /** @param parent May be null. */
90
+ constructor(data: BoneData, skeleton: Skeleton, parent: Bone);
91
+ /** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the
92
+ * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */
93
+ isActive(): boolean;
94
+ /** Computes the world transform using the parent bone and this bone's local applied transform. */
95
+ update(): void;
96
+ /** Computes the world transform using the parent bone and this bone's local transform.
97
+ *
98
+ * See {@link #updateWorldTransformWith()}. */
99
+ updateWorldTransform(): void;
100
+ /** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the
101
+ * specified local transform. Child bones are not updated.
102
+ *
103
+ * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine
104
+ * Runtimes Guide. */
105
+ updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void;
106
+ /** Sets this bone's local transform to the setup pose. */
107
+ setToSetupPose(): void;
108
+ /** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */
109
+ getWorldRotationX(): number;
110
+ /** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */
111
+ getWorldRotationY(): number;
112
+ /** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */
113
+ getWorldScaleX(): number;
114
+ /** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */
115
+ getWorldScaleY(): number;
116
+ /** Computes the applied transform values from the world transform.
117
+ *
118
+ * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so
119
+ * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other
120
+ * constraints).
121
+ *
122
+ * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after
123
+ * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */
124
+ updateAppliedTransform(): void;
125
+ /** Transforms a point from world coordinates to the bone's local coordinates. */
126
+ worldToLocal(world: Vector2): Vector2;
127
+ /** Transforms a point from the bone's local coordinates to world coordinates. */
128
+ localToWorld(local: Vector2): Vector2;
129
+ /** Transforms a world rotation to a local rotation. */
130
+ worldToLocalRotation(worldRotation: number): number;
131
+ /** Transforms a local rotation to a world rotation. */
132
+ localToWorldRotation(localRotation: number): number;
133
+ /** Rotates the world transform the specified amount.
134
+ * <p>
135
+ * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and {@link #update()} will
136
+ * need to be called on any child bones, recursively. */
137
+ rotateWorld(degrees: number): void;
138
+ }