@esotericsoftware/spine-core 4.0.15 → 4.0.19

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 +1969 -1950
  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 +51 -51
  10. package/dist/AtlasAttachmentLoader.js +75 -74
  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 +158 -158
  30. package/dist/Skeleton.js +589 -571
  31. package/dist/SkeletonBinary.d.ts +67 -67
  32. package/dist/SkeletonBinary.js +1095 -1094
  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 +51 -51
  40. package/dist/SkeletonJson.js +917 -916
  41. package/dist/Skin.d.ts +71 -71
  42. package/dist/Skin.js +203 -201
  43. package/dist/Slot.d.ts +72 -72
  44. package/dist/Slot.js +107 -94
  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 +71 -71
  64. package/dist/attachments/Attachment.js +148 -140
  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 +51 -48
  71. package/dist/attachments/MeshAttachment.d.ts +74 -74
  72. package/dist/attachments/MeshAttachment.js +181 -160
  73. package/dist/attachments/PathAttachment.d.ts +47 -47
  74. package/dist/attachments/PathAttachment.js +59 -57
  75. package/dist/attachments/PointAttachment.d.ts +48 -48
  76. package/dist/attachments/PointAttachment.js +66 -63
  77. package/dist/attachments/RegionAttachment.d.ts +108 -108
  78. package/dist/attachments/RegionAttachment.js +201 -197
  79. package/dist/attachments/index.d.ts +8 -8
  80. package/dist/attachments/index.js +8 -8
  81. package/dist/iife/spine-core.js +170 -9
  82. package/dist/iife/spine-core.js.map +2 -2
  83. package/dist/iife/spine-core.min.js +2 -2
  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,51 +1,51 @@
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 { 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
- /** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.
39
- *
40
- * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the
41
- * Spine Runtimes Guide. */
42
- export declare class AtlasAttachmentLoader implements AttachmentLoader {
43
- atlas: TextureAtlas;
44
- constructor(atlas: TextureAtlas);
45
- newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
46
- newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
47
- newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
48
- newPathAttachment(skin: Skin, name: string): PathAttachment;
49
- newPointAttachment(skin: Skin, name: string): PointAttachment;
50
- newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
51
- }
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 { 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
+ /** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.
39
+ *
40
+ * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the
41
+ * Spine Runtimes Guide. */
42
+ export declare class AtlasAttachmentLoader implements AttachmentLoader {
43
+ atlas: TextureAtlas;
44
+ constructor(atlas: TextureAtlas);
45
+ newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
46
+ newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
47
+ newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
48
+ newPathAttachment(skin: Skin, name: string): PathAttachment;
49
+ newPointAttachment(skin: Skin, name: string): PointAttachment;
50
+ newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
51
+ }
@@ -1,74 +1,75 @@
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 { 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
- newRegionAttachment(skin, name, path) {
44
- let region = this.atlas.findRegion(path);
45
- if (!region)
46
- throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
47
- region.renderObject = region;
48
- let attachment = new RegionAttachment(name);
49
- attachment.setRegion(region);
50
- return attachment;
51
- }
52
- newMeshAttachment(skin, name, path) {
53
- let region = this.atlas.findRegion(path);
54
- if (!region)
55
- throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
56
- region.renderObject = region;
57
- let attachment = new MeshAttachment(name);
58
- attachment.region = region;
59
- return attachment;
60
- }
61
- newBoundingBoxAttachment(skin, name) {
62
- return new BoundingBoxAttachment(name);
63
- }
64
- newPathAttachment(skin, name) {
65
- return new PathAttachment(name);
66
- }
67
- newPointAttachment(skin, name) {
68
- return new PointAttachment(name);
69
- }
70
- newClippingAttachment(skin, name) {
71
- return new ClippingAttachment(name);
72
- }
73
- }
74
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXRsYXNBdHRhY2htZW50TG9hZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0F0bGFzQXR0YWNobWVudExvYWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OytFQTJCK0U7QUFHL0UsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFDNUUsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFDdEUsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBQzlELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQztBQUM5RCxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDaEUsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFJbEU7OzsyQkFHMkI7QUFDM0IsTUFBTSxPQUFPLHFCQUFxQjtJQUdqQyxZQUFhLEtBQW1CO1FBQy9CLElBQUksQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFDO0lBQ3BCLENBQUM7SUFFRCxtQkFBbUIsQ0FBRSxJQUFVLEVBQUUsSUFBWSxFQUFFLElBQVk7UUFDMUQsSUFBSSxNQUFNLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDekMsSUFBSSxDQUFDLE1BQU07WUFBRSxNQUFNLElBQUksS0FBSyxD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LElBQVk7UUFDM0MsT0FBTyxJQUFJLGVBQWUsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNsQyxDQUFDO0lBRUQscUJBQXFCLENBQUUsSUFBVSxFQUFFLElBQVk7UUFDOUMsT0FBTyxJQUFJLGtCQUFrQixDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3JDLENBQUM7Q0FDRCJ9
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 { 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
+ newRegionAttachment(skin, name, path) {
45
+ let region = this.atlas.findRegion(path);
46
+ if (!region)
47
+ throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
48
+ region.renderObject = region;
49
+ let attachment = new RegionAttachment(name);
50
+ attachment.setRegion(region);
51
+ return attachment;
52
+ }
53
+ newMeshAttachment(skin, name, path) {
54
+ let region = this.atlas.findRegion(path);
55
+ if (!region)
56
+ throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
57
+ region.renderObject = region;
58
+ let attachment = new MeshAttachment(name);
59
+ attachment.region = region;
60
+ return attachment;
61
+ }
62
+ newBoundingBoxAttachment(skin, name) {
63
+ return new BoundingBoxAttachment(name);
64
+ }
65
+ newPathAttachment(skin, name) {
66
+ return new PathAttachment(name);
67
+ }
68
+ newPointAttachment(skin, name) {
69
+ return new PointAttachment(name);
70
+ }
71
+ newClippingAttachment(skin, name) {
72
+ return new ClippingAttachment(name);
73
+ }
74
+ }
75
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW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UFFLElBQVk7UUFDOUMsT0FBTyxJQUFJLGtCQUFrQixDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3JDLENBQUM7Q0FDRCJ9
package/dist/Bone.d.ts CHANGED
@@ -1,138 +1,138 @@
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 { 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 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 { 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
+ }