@esotericsoftware/spine-core 4.0.9 → 4.0.13
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.
- package/dist/Animation.js +577 -710
- package/dist/AnimationState.js +239 -259
- package/dist/AnimationStateData.js +15 -17
- package/dist/AssetManagerBase.d.ts +3 -0
- package/dist/AssetManagerBase.js +168 -147
- package/dist/AtlasAttachmentLoader.js +20 -22
- package/dist/Bone.js +89 -91
- package/dist/BoneData.js +4 -6
- package/dist/ConstraintData.js +4 -6
- package/dist/Event.js +4 -6
- package/dist/EventData.js +4 -6
- package/dist/IkConstraint.js +48 -50
- package/dist/IkConstraintData.js +12 -31
- package/dist/PathConstraint.js +116 -118
- package/dist/PathConstraintData.js +9 -28
- package/dist/Skeleton.js +189 -192
- package/dist/SkeletonBinary.js +352 -363
- package/dist/SkeletonBounds.js +79 -81
- package/dist/SkeletonClipping.js +86 -88
- package/dist/SkeletonData.js +46 -48
- package/dist/SkeletonJson.js +307 -310
- package/dist/Skin.js +65 -69
- package/dist/Slot.js +16 -18
- package/dist/SlotData.js +4 -6
- package/dist/Texture.js +14 -39
- package/dist/TextureAtlas.js +56 -85
- package/dist/TransformConstraint.js +77 -79
- package/dist/TransformConstraintData.js +20 -39
- package/dist/Triangulator.js +71 -73
- package/dist/Updatable.js +1 -1
- package/dist/Utils.js +183 -245
- package/dist/VertexEffect.js +1 -1
- package/dist/attachments/Attachment.js +41 -62
- package/dist/attachments/AttachmentLoader.js +1 -1
- package/dist/attachments/BoundingBoxAttachment.js +9 -28
- package/dist/attachments/ClippingAttachment.js +9 -28
- package/dist/attachments/MeshAttachment.js +29 -48
- package/dist/attachments/PathAttachment.js +11 -30
- package/dist/attachments/PointAttachment.js +16 -35
- package/dist/attachments/RegionAttachment.js +82 -101
- package/dist/attachments/index.js +1 -1
- package/dist/iife/spine-core.js +62 -22
- package/dist/iife/spine-core.js.map +2 -2
- package/dist/iife/spine-core.min.js +2 -2
- package/dist/index.js +1 -1
- package/dist/polyfills.js +2 -2
- package/dist/vertexeffects/JitterEffect.js +10 -12
- package/dist/vertexeffects/SwirlEffect.js +18 -20
- package/package.json +1 -1
- package/dist/Animation.js.map +0 -1
- package/dist/AnimationState.js.map +0 -1
- package/dist/AnimationStateData.js.map +0 -1
- package/dist/AssetManagerBase.js.map +0 -1
- package/dist/AtlasAttachmentLoader.js.map +0 -1
- package/dist/Bone.js.map +0 -1
- package/dist/BoneData.js.map +0 -1
- package/dist/ConstraintData.js.map +0 -1
- package/dist/Event.js.map +0 -1
- package/dist/EventData.js.map +0 -1
- package/dist/IkConstraint.js.map +0 -1
- package/dist/IkConstraintData.js.map +0 -1
- package/dist/PathConstraint.js.map +0 -1
- package/dist/PathConstraintData.js.map +0 -1
- package/dist/Skeleton.js.map +0 -1
- package/dist/SkeletonBinary.js.map +0 -1
- package/dist/SkeletonBounds.js.map +0 -1
- package/dist/SkeletonClipping.js.map +0 -1
- package/dist/SkeletonData.js.map +0 -1
- package/dist/SkeletonJson.js.map +0 -1
- package/dist/Skin.js.map +0 -1
- package/dist/Slot.js.map +0 -1
- package/dist/SlotData.js.map +0 -1
- package/dist/Texture.js.map +0 -1
- package/dist/TextureAtlas.js.map +0 -1
- package/dist/TransformConstraint.js.map +0 -1
- package/dist/TransformConstraintData.js.map +0 -1
- package/dist/Triangulator.js.map +0 -1
- package/dist/Updatable.js.map +0 -1
- package/dist/Utils.js.map +0 -1
- package/dist/VertexEffect.js.map +0 -1
- package/dist/attachments/Attachment.js.map +0 -1
- package/dist/attachments/AttachmentLoader.js.map +0 -1
- package/dist/attachments/BoundingBoxAttachment.js.map +0 -1
- package/dist/attachments/ClippingAttachment.js.map +0 -1
- package/dist/attachments/MeshAttachment.js.map +0 -1
- package/dist/attachments/PathAttachment.js.map +0 -1
- package/dist/attachments/PointAttachment.js.map +0 -1
- package/dist/attachments/RegionAttachment.js.map +0 -1
- package/dist/attachments/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/polyfills.js.map +0 -1
- package/dist/vertexeffects/JitterEffect.js.map +0 -1
- package/dist/vertexeffects/SwirlEffect.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoundingBoxAttachment.js","sourceRoot":"","sources":["../../src/attachments/BoundingBoxAttachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;;;;;;;;;;;;;;;;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAc,MAAM,cAAc,CAAC;AAE5D;;;;YAIY;AACZ;IAA2C,yCAAgB;IAG1D,+BAAa,IAAY;QAAzB,YACC,kBAAM,IAAI,CAAC,SACX;QAJD,WAAK,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;;IAI9B,CAAC;IAED,oCAAI,GAAJ;QACC,IAAI,IAAI,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;IACF,4BAAC;AAAD,CAAC,AAbD,CAA2C,gBAAgB,GAa1D","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color } from \"../Utils\";\nimport { VertexAttachment, Attachment } from \"./Attachment\";\n\n/** An attachment with vertices that make up a polygon. Can be used for hit detection, creating physics bodies, spawning particle\n * effects, and more.\n *\n * See {@link SkeletonBounds} and [Bounding Boxes](http://esotericsoftware.com/spine-bounding-boxes) in the Spine User\n * Guide. */\nexport class BoundingBoxAttachment extends VertexAttachment {\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new BoundingBoxAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClippingAttachment.js","sourceRoot":"","sources":["../../src/attachments/ClippingAttachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;;;;;;;;;;;;;;;;AAG/E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAc,MAAM,cAAc,CAAC;AAE5D,+GAA+G;AAC/G;IAAwC,sCAAgB;IAUvD,4BAAa,IAAY;QAAzB,YACC,kBAAM,IAAI,CAAC,SACX;QAPD,gBAAgB;QAChB;kDAC0C;QAC1C,WAAK,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW;;IAIzD,CAAC;IAED,iCAAI,GAAJ;QACC,IAAI,IAAI,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;IACF,yBAAC;AAAD,CAAC,AArBD,CAAwC,gBAAgB,GAqBvD","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { SlotData } from \"../SlotData\";\nimport { Color } from \"../Utils\";\nimport { VertexAttachment, Attachment } from \"./Attachment\";\n\n/** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */\nexport class ClippingAttachment extends VertexAttachment {\n\t/** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of\n\t * the skeleton's rendering. */\n\tendSlot: SlotData;\n\n\t// Nonessential.\n\t/** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new ClippingAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.endSlot = this.endSlot;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MeshAttachment.js","sourceRoot":"","sources":["../../src/attachments/MeshAtt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C,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACjE;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE1B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,kHAAkH;IAClH,sCAAa,GAAb;QACC,IAAI,IAAI,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC9C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACb,CAAC;IACF,qBAAC;AAAD,CAAC,AAjKD,CAAoC,gBAAgB,GAiKnD","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TextureRegion } from \"../Texture\";\nimport { TextureAtlasRegion } from \"../TextureAtlas\";\nimport { Color, NumberArrayLike, Utils } from \"../Utils\";\nimport { VertexAttachment, Attachment } from \"./Attachment\";\n\n/** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not\n * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.\n *\n * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */\nexport class MeshAttachment extends VertexAttachment {\n\tregion: TextureRegion;\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\t/** The UV pair for each vertex, normalized within the texture region. */\n\tregionUVs: NumberArrayLike;\n\n\t/** The UV pair for each vertex, normalized within the entire texture.\n\t *\n\t * See {@link #updateUVs}. */\n\tuvs: NumberArrayLike;\n\n\t/** Triplets of vertex indices which describe the mesh's triangulation. */\n\ttriangles: Array<number>;\n\n\t/** The color to tint the mesh. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The width of the mesh's image. Available only when nonessential data was exported. */\n\twidth: number;\n\n\t/** The height of the mesh's image. Available only when nonessential data was exported. */\n\theight: number;\n\n\t/** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */\n\thullLength: number;\n\n\t/** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if\n\t * nonessential data was exported. Triangulation is not performed at runtime. */\n\tedges: Array<number>;\n\n\tprivate parentMesh: MeshAttachment;\n\ttempColor = new Color(0, 0, 0, 0);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\t/** Calculates {@link #uvs} using {@link #regionUVs} and the {@link #region}. Must be called after changing the region UVs or\n\t * region. */\n\tupdateUVs () {\n\t\tlet regionUVs = this.regionUVs;\n\t\tif (!this.uvs || this.uvs.length != regionUVs.length) this.uvs = Utils.newFloatArray(regionUVs.length);\n\t\tlet uvs = this.uvs;\n\t\tlet n = this.uvs.length;\n\t\tlet u = this.region.u, v = this.region.v, width = 0, height = 0;\n\t\tif (this.region instanceof TextureAtlasRegion) {\n\t\t\tlet region = this.region, image = region.page.texture.getImage();\n\t\t\tlet textureWidth = image.width, textureHeight = image.height;\n\t\t\tswitch (region.degrees) {\n\t\t\t\tcase 90:\n\t\t\t\t\tu -= (region.originalHeight - region.offsetY - region.height) / textureWidth;\n\t\t\t\t\tv -= (region.originalWidth - region.offsetX - region.width) / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + regionUVs[i + 1] * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 180:\n\t\t\t\t\tu -= (region.originalWidth - region.offsetX - region.width) / textureWidth;\n\t\t\t\t\tv -= region.offsetY / textureHeight;\n\t\t\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\t\t\theight = region.originalHeight / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 270:\n\t\t\t\t\tu -= region.offsetY / textureWidth;\n\t\t\t\t\tv -= region.offsetX / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i + 1]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + regionUVs[i] * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tu -= region.offsetX / textureWidth;\n\t\t\tv -= (region.originalHeight - region.offsetY - region.height) / textureHeight;\n\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\theight = region.originalHeight / textureHeight;\n\t\t} else if (!this.region) {\n\t\t\tu = v = 0;\n\t\t\twidth = height = 1;\n\t\t} else {\n\t\t\twidth = this.region.u2 - u;\n\t\t\theight = this.region.v2 - v;\n\t\t}\n\n\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\tuvs[i] = u + regionUVs[i] * width;\n\t\t\tuvs[i + 1] = v + regionUVs[i + 1] * height;\n\t\t}\n\t}\n\n\t/** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},\n\t * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the\n\t * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */\n\tgetParentMesh () {\n\t\treturn this.parentMesh;\n\t}\n\n\t/** @param parentMesh May be null. */\n\tsetParentMesh (parentMesh: MeshAttachment) {\n\t\tthis.parentMesh = parentMesh;\n\t\tif (parentMesh) {\n\t\t\tthis.bones = parentMesh.bones;\n\t\t\tthis.vertices = parentMesh.vertices;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\n\t\t\tthis.regionUVs = parentMesh.regionUVs;\n\t\t\tthis.triangles = parentMesh.triangles;\n\t\t\tthis.hullLength = parentMesh.hullLength;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength\n\t\t}\n\t}\n\n\tcopy (): Attachment {\n\t\tif (this.parentMesh) return this.newLinkedMesh();\n\n\t\tlet copy = new MeshAttachment(this.name);\n\t\tcopy.region = this.region;\n\t\tcopy.path = this.path;\n\t\tcopy.color.setFromColor(this.color);\n\n\t\tthis.copyTo(copy);\n\t\tcopy.regionUVs = new Array<number>(this.regionUVs.length);\n\t\tUtils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\n\t\tcopy.uvs = new Array<number>(this.uvs.length);\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);\n\t\tcopy.triangles = new Array<number>(this.triangles.length);\n\t\tUtils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\n\t\tcopy.hullLength = this.hullLength;\n\n\t\t// Nonessential.\n\t\tif (this.edges) {\n\t\t\tcopy.edges = new Array<number>(this.edges.length);\n\t\t\tUtils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\n\t\t}\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\n\t\treturn copy;\n\t}\n\n\t/** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/\n\tnewLinkedMesh (): MeshAttachment {\n\t\tlet copy = new MeshAttachment(this.name);\n\t\tcopy.region = this.region;\n\t\tcopy.path = this.path;\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.deformAttachment = this.deformAttachment;\n\t\tcopy.setParentMesh(this.parentMesh ? this.parentMesh : this);\n\t\tcopy.updateUVs();\n\t\treturn copy;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PathAttachment.js","sourceRoot":"","sources":["../../src/attachments/PathAttachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;;;;;;;;;;;;;;;;AAE/E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAc,MAAM,cAAc,CAAC;AAE5D;;8GAE8G;AAC9G;IAAoC,kCAAgB;IAgBnD,wBAAa,IAAY;QAAzB,YACC,kBAAM,IAAI,CAAC,SACX;QAbD,sDAAsD;QACtD,YAAM,GAAG,KAAK,CAAC;QAEf;mGAC2F;QAC3F,mBAAa,GAAG,KAAK,CAAC;QAEtB;kCAC0B;QAC1B,WAAK,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;;IAI9B,CAAC;IAED,6BAAI,GAAJ;QACC,IAAI,IAAI,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAS,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACtD,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;IACF,qBAAC;AAAD,CAAC,AA9BD,CAAoC,gBAAgB,GA8BnD","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color, Utils } from \"../Utils\";\nimport { VertexAttachment, Attachment } from \"./Attachment\";\n\n/** An attachment whose vertices make up a composite Bezier curve.\n *\n * See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */\nexport class PathAttachment extends VertexAttachment {\n\n\t/** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */\n\tlengths: Array<number>;\n\n\t/** If true, the start and end knots are connected. */\n\tclosed = false;\n\n\t/** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer\n\t * calculations are performed but calculating positions along the path is less accurate. */\n\tconstantSpeed = false;\n\n\t/** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually\n\t * rendered at runtime. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new PathAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.lengths = new Array<number>(this.lengths.length);\n\t\tUtils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\n\t\tcopy.closed = closed;\n\t\tcopy.constantSpeed = this.constantSpeed;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PointAttachment.js","sourceRoot":"","sources":["../../src/attachments/PointAttachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;;;;;;;;;;;;;;;;AAG/E,OAAO,EAAE,KAAK,EAAW,SAAS,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAc,MAAM,cAAc,CAAC;AAE5D;;;;2GAI2G;AAC3G;IAAqC,mCAAgB;IAOpD,yBAAa,IAAY;QAAzB,YACC,kBAAM,IAAI,CAAC,SACX;QAND;kDAC0C;QAC1C,WAAK,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;;IAIpC,CAAC;IAED,8CAAoB,GAApB,UAAsB,IAAU,EAAE,KAAc;QAC/C,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1D,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1D,OAAO,KAAK,CAAC;IACd,CAAC;IAED,8CAAoB,GAApB,UAAsB,IAAU;QAC/B,IAAI,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjF,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC;IAC5C,CAAC;IAED,8BAAI,GAAJ;QACC,IAAI,IAAI,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;IACF,sBAAC;AAAD,CAAC,AAhCD,CAAqC,gBAAgB,GAgCpD","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"../Bone\";\nimport { Color, Vector2, MathUtils } from \"../Utils\";\nimport { VertexAttachment, Attachment } from \"./Attachment\";\n\n/** An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be\n * used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a\n * skin.\n *\n * See [Point Attachments](http://esotericsoftware.com/spine-point-attachments) in the Spine User Guide. */\nexport class PointAttachment extends VertexAttachment {\n\tx: number; y: number; rotation: number;\n\n\t/** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.38, 0.94, 0, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcomputeWorldPosition (bone: Bone, point: Vector2) {\n\t\tpoint.x = this.x * bone.a + this.y * bone.b + bone.worldX;\n\t\tpoint.y = this.x * bone.c + this.y * bone.d + bone.worldY;\n\t\treturn point;\n\t}\n\n\tcomputeWorldRotation (bone: Bone) {\n\t\tlet cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\n\t\tlet x = cos * bone.a + sin * bone.b;\n\t\tlet y = cos * bone.c + sin * bone.d;\n\t\treturn Math.atan2(y, x) * MathUtils.radDeg;\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new PointAttachment(this.name);\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RegionAttachment.js","sourceRoot":"","sources":["../../src/attachments/RegionAttachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;;;;;;;;;;;;;;;;AAI/E,OAAO,EAAE,KAAK,EAAmB,KAAK,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;kGAEkG;AAClG;IAAsC,oCAAU;IAwC/C,0BAAa,IAAY;QAAzB,YACC,kBAAM,IAAI,CAAC,SACX;QAzCD,+BAA+B;QAC/B,OAAC,GAAG,CAAC,CAAC;QAEN,+BAA+B;QAC/B,OAAC,GAAG,CAAC,CAAC;QAEN,wBAAwB;QACxB,YAAM,GAAG,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C;IACT,oBAAG,GAAG,EAAE,CAAC;IACT,oBAAG,GAAG,EAAE,CAAC;IACT,mBAAE,GAAG,EAAE,CAAC;IACR,mBAAE,GAAG,EAAE,CAAC;IAChB,uBAAC;CAAA,AA9LD,CAAsC,UAAU,GA8L/C;SA9LY,gBAAgB","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"../Bone\";\nimport { TextureRegion } from \"../Texture\";\nimport { Color, NumberArrayLike, Utils } from \"../Utils\";\nimport { Attachment } from \"./Attachment\";\n\n/** An attachment that displays a textured quadrilateral.\n *\n * See [Region attachments](http://esotericsoftware.com/spine-regions) in the Spine User Guide. */\nexport class RegionAttachment extends Attachment {\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 1;\n\n\t/** The local scaleY. */\n\tscaleY = 1;\n\n\t/** The local rotation. */\n\trotation = 0;\n\n\t/** The width of the region attachment in Spine. */\n\twidth = 0;\n\n\t/** The height of the region attachment in Spine. */\n\theight = 0;\n\n\t/** The color to tint the region attachment. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\trendererObject: any;\n\tregion: TextureRegion;\n\n\t/** For each of the 4 vertices, a pair of <code>x,y</code> values that is the local position of the vertex.\n\t *\n\t * See {@link #updateOffset()}. */\n\toffset = Utils.newFloatArray(8);\n\n\tuvs = Utils.newFloatArray(8);\n\n\ttempColor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\t/** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */\n\tupdateOffset (): void {\n\t\tlet region = this.region;\n\t\tlet regionScaleX = this.width / this.region.originalWidth * this.scaleX;\n\t\tlet regionScaleY = this.height / this.region.originalHeight * this.scaleY;\n\t\tlet localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\n\t\tlet localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\n\t\tlet localX2 = localX + this.region.width * regionScaleX;\n\t\tlet localY2 = localY + this.region.height * regionScaleY;\n\t\tlet radians = this.rotation * Math.PI / 180;\n\t\tlet cos = Math.cos(radians);\n\t\tlet sin = Math.sin(radians);\n\t\tlet x = this.x, y = this.y;\n\t\tlet localXCos = localX * cos + x;\n\t\tlet localXSin = localX * sin;\n\t\tlet localYCos = localY * cos + y;\n\t\tlet localYSin = localY * sin;\n\t\tlet localX2Cos = localX2 * cos + x;\n\t\tlet localX2Sin = localX2 * sin;\n\t\tlet localY2Cos = localY2 * cos + y;\n\t\tlet localY2Sin = localY2 * sin;\n\t\tlet offset = this.offset;\n\t\toffset[0] = localXCos - localYSin;\n\t\toffset[1] = localYCos + localXSin;\n\t\toffset[2] = localXCos - localY2Sin;\n\t\toffset[3] = localY2Cos + localXSin;\n\t\toffset[4] = localX2Cos - localY2Sin;\n\t\toffset[5] = localY2Cos + localX2Sin;\n\t\toffset[6] = localX2Cos - localYSin;\n\t\toffset[7] = localYCos + localX2Sin;\n\t}\n\n\tsetRegion (region: TextureRegion): void {\n\t\tthis.region = region;\n\t\tlet uvs = this.uvs;\n\t\tif (region.degrees == 90) {\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v2;\n\t\t\tuvs[4] = region.u;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v;\n\t\t\tuvs[0] = region.u2;\n\t\t\tuvs[1] = region.v2;\n\t\t} else {\n\t\t\tuvs[0] = region.u;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v;\n\t\t\tuvs[4] = region.u2;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v2;\n\t\t}\n\t}\n\n\t/** Transforms the attachment's four vertices to world coordinates.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide.\n\t * @param worldVertices The output world vertices. Must have a length >= `offset` + 8.\n\t * @param offset The `worldVertices` index to begin writing values.\n\t * @param stride The number of `worldVertices` entries between the value pairs written. */\n\tcomputeWorldVertices (bone: Bone, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tlet vertexOffset = this.offset;\n\t\tlet x = bone.worldX, y = bone.worldY;\n\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\tlet offsetX = 0, offsetY = 0;\n\n\t\toffsetX = vertexOffset[0];\n\t\toffsetY = vertexOffset[1];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // br\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[2];\n\t\toffsetY = vertexOffset[3];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // bl\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[4];\n\t\toffsetY = vertexOffset[5];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ul\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[6];\n\t\toffsetY = vertexOffset[7];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ur\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new RegionAttachment(this.name);\n\t\tcopy.region = this.region;\n\t\tcopy.rendererObject = this.rendererObject;\n\t\tcopy.path = this.path;\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.scaleX = this.scaleX;\n\t\tcopy.scaleY = this.scaleY;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\n\t\tUtils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n\n\tstatic X1 = 0;\n\tstatic Y1 = 1;\n\tstatic C1R = 2;\n\tstatic C1G = 3;\n\tstatic C1B = 4;\n\tstatic C1A = 5;\n\tstatic U1 = 6;\n\tstatic V1 = 7;\n\n\tstatic X2 = 8;\n\tstatic Y2 = 9;\n\tstatic C2R = 10;\n\tstatic C2G = 11;\n\tstatic C2B = 12;\n\tstatic C2A = 13;\n\tstatic U2 = 14;\n\tstatic V2 = 15;\n\n\tstatic X3 = 16;\n\tstatic Y3 = 17;\n\tstatic C3R = 18;\n\tstatic C3G = 19;\n\tstatic C3B = 20;\n\tstatic C3A = 21;\n\tstatic U3 = 22;\n\tstatic V3 = 23;\n\n\tstatic X4 = 24;\n\tstatic Y4 = 25;\n\tstatic C4R = 26;\n\tstatic C4G = 27;\n\tstatic C4B = 28;\n\tstatic C4A = 29;\n\tstatic U4 = 30;\n\tstatic V4 = 31;\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/attachments/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './Attachment';\nexport * from './AttachmentLoader';\nexport * from './BoundingBoxAttachment';\nexport * from './ClippingAttachment';\nexport * from './MeshAttachment';\nexport * from './PathAttachment';\nexport * from './PointAttachment';\nexport * from './RegionAttachment';\n"]}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './Animation';\nexport * from './AnimationState';\nexport * from './AnimationStateData';\nexport * from './AtlasAttachmentLoader';\nexport * from './Bone';\nexport * from './BoneData';\nexport * from './ConstraintData';\nexport * from './AssetManagerBase';\nexport * from './Event';\nexport * from './EventData';\nexport * from './IkConstraint';\nexport * from './IkConstraintData';\nexport * from './PathConstraint';\nexport * from './PathConstraintData';\nexport * from './Skeleton';\nexport * from './SkeletonBinary';\nexport * from './SkeletonBounds';\nexport * from './SkeletonClipping';\nexport * from './SkeletonData';\nexport * from './SkeletonJson';\nexport * from './Skin';\nexport * from './Slot';\nexport * from './SlotData';\nexport * from './Texture';\nexport * from './TextureAtlas';\nexport * from './TransformConstraint';\nexport * from './TransformConstraintData';\nexport * from './Triangulator';\nexport * from './Updatable';\nexport * from './Utils';\nexport * from './VertexEffect';\nexport * from './polyfills';\nexport * from './attachments/Attachment';\nexport * from './attachments/AttachmentLoader';\nexport * from './attachments/BoundingBoxAttachment';\nexport * from './attachments/ClippingAttachment';\nexport * from './attachments/MeshAttachment';\nexport * from './attachments/PathAttachment';\nexport * from './attachments/PointAttachment';\nexport * from './attachments/RegionAttachment';\nexport * from './vertexeffects/JitterEffect';\nexport * from './vertexeffects/SwirlEffect';\n"]}
|
package/dist/polyfills.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polyfills.js","sourceRoot":"","sources":["../src/polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;AAE/E,CAAC;IACA,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,WAAW,EAAE;QACvC,IAAI,CAAC,MAAM,GAAG,CAAC,UAAU,KAAK;YAC7B,OAAO,UAAU,CAAS;gBACzB,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/B,CAAC,CAAC;QACH,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;KACxB;AACF,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n(() => {\n\tif (typeof Math.fround === \"undefined\") {\n\t\tMath.fround = (function (array) {\n\t\t\treturn function (x: number) {\n\t\t\t\treturn array[0] = x, array[0];\n\t\t\t};\n\t\t})(new Float32Array(1));\n\t}\n})();\n\nexport { }"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JitterEffect.js","sourceRoot":"","sources":["../../src/vertexeffects/JitterEffect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;AAG/E,OAAO,EAAkB,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrD;IAIC,sBAAa,OAAe,EAAE,OAAe;QAH7C,YAAO,GAAG,CAAC,CAAC;QACZ,YAAO,GAAG,CAAC,CAAC;QAGX,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED,4BAAK,GAAL,UAAO,QAAkB;IACzB,CAAC;IAED,gCAAS,GAAT,UAAW,QAAiB,EAAE,EAAW,EAAE,KAAY,EAAE,IAAW;QACnE,QAAQ,CAAC,CAAC,IAAI,SAAS,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,QAAQ,CAAC,CAAC,IAAI,SAAS,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACvE,CAAC;IAED,0BAAG,GAAH;IACA,CAAC;IACF,mBAAC;AAAD,CAAC,AAnBD,IAmBC","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Skeleton } from \"../Skeleton\";\nimport { Vector2, Color, MathUtils } from \"../Utils\";\nimport { VertexEffect } from \"../VertexEffect\";\n\nexport class JitterEffect implements VertexEffect {\n\tjitterX = 0;\n\tjitterY = 0;\n\n\tconstructor (jitterX: number, jitterY: number) {\n\t\tthis.jitterX = jitterX;\n\t\tthis.jitterY = jitterY;\n\t}\n\n\tbegin (skeleton: Skeleton): void {\n\t}\n\n\ttransform (position: Vector2, uv: Vector2, light: Color, dark: Color): void {\n\t\tposition.x += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\n\t\tposition.y += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\n\t}\n\n\tend (): void {\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwirlEffect.js","sourceRoot":"","sources":["../../src/vertexeffects/SwirlEffect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2B+E;AAG/E,OAAO,EAAE,MAAM,EAAkB,SAAS,EAAE,MAAM,UAAU,CAAC;AAG7D;IASC,qBAAa,MAAc;QAP3B,YAAO,GAAG,CAAC,CAAC;QACZ,YAAO,GAAG,CAAC,CAAC;QACZ,WAAM,GAAG,CAAC,CAAC;QACX,UAAK,GAAG,CAAC,CAAC;QACF,WAAM,GAAG,CAAC,CAAC;QACX,WAAM,GAAG,CAAC,CAAC;QAGlB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,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AM,CAAC,CAAC,CAAC,CAAC;IAiCtC,kBAAC;CAAA,AAlCD,IAkCC;SAlCY,WAAW","sourcesContent":["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated January 1, 2020. Replaces all prior versions.\n *\n * Copyright (c) 2013-2020, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Skeleton } from \"../Skeleton\";\nimport { PowOut, Vector2, Color, MathUtils } from \"../Utils\";\nimport { VertexEffect } from \"../VertexEffect\";\n\nexport class SwirlEffect implements VertexEffect {\n\tstatic interpolation = new PowOut(2);\n\tcenterX = 0;\n\tcenterY = 0;\n\tradius = 0;\n\tangle = 0;\n\tprivate worldX = 0;\n\tprivate worldY = 0;\n\n\tconstructor (radius: number) {\n\t\tthis.radius = radius;\n\t}\n\n\tbegin (skeleton: Skeleton): void {\n\t\tthis.worldX = skeleton.x + this.centerX;\n\t\tthis.worldY = skeleton.y + this.centerY;\n\t}\n\n\ttransform (position: Vector2, uv: Vector2, light: Color, dark: Color): void {\n\t\tlet radAngle = this.angle * MathUtils.degreesToRadians;\n\t\tlet x = position.x - this.worldX;\n\t\tlet y = position.y - this.worldY;\n\t\tlet dist = Math.sqrt(x * x + y * y);\n\t\tif (dist < this.radius) {\n\t\t\tlet theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\n\t\t\tlet cos = Math.cos(theta);\n\t\t\tlet sin = Math.sin(theta);\n\t\t\tposition.x = cos * x - sin * y + this.worldX;\n\t\t\tposition.y = sin * x + cos * y + this.worldY;\n\t\t}\n\t}\n\n\tend (): void {\n\t}\n}\n"]}
|