Ver Fonte

Merge remote-tracking branch 'origin/3.6-beta' into 3.6-beta

NathanSweet há 8 anos atrás
pai
commit
c4268d4bfe
55 ficheiros alterados com 23372 adições e 21770 exclusões
  1. 7 0
      CHANGELOG.md
  2. BIN
      spine-as3/spine-as3-example/lib/spine-as3.swc
  3. 4 1
      spine-as3/spine-as3/src/spine/animation/AnimationState.as
  4. 1 1
      spine-as3/spine-as3/src/spine/animation/DeformTimeline.as
  5. 1 1
      spine-c/spine-c/include/spine/AnimationState.h
  6. 1 1
      spine-c/spine-c/src/spine/Animation.c
  7. 4 1
      spine-c/spine-c/src/spine/AnimationState.c
  8. 1 1
      spine-csharp/src/Animation.cs
  9. 4 1
      spine-csharp/src/AnimationState.cs
  10. 2 2
      spine-csharp/src/Attachments/MeshAttachment.cs
  11. 2 2
      spine-csharp/src/Attachments/PointAttachment.cs
  12. 1 1
      spine-csharp/src/Attachments/RegionAttachment.cs
  13. 1 1
      spine-csharp/src/Attachments/VertexAttachment.cs
  14. 1 1
      spine-csharp/src/IkConstraint.cs
  15. 1 1
      spine-lua/Animation.lua
  16. 3 0
      spine-lua/AnimationState.lua
  17. BIN
      spine-starling/spine-starling-example/lib/spine-as3.swc
  18. BIN
      spine-starling/spine-starling/lib/spine-as3.swc
  19. 301 301
      spine-ts/build/spine-all.d.ts
  20. 997 332
      spine-ts/build/spine-all.js
  21. 0 0
      spine-ts/build/spine-all.js.map
  22. 243 243
      spine-ts/build/spine-canvas.d.ts
  23. 779 338
      spine-ts/build/spine-canvas.js
  24. 0 0
      spine-ts/build/spine-canvas.js.map
  25. 149 149
      spine-ts/build/spine-core.d.ts
  26. 4007 4022
      spine-ts/build/spine-core.js
  27. 0 0
      spine-ts/build/spine-core.js.map
  28. 149 149
      spine-ts/build/spine-threejs.d.ts
  29. 4007 4022
      spine-ts/build/spine-threejs.js
  30. 0 0
      spine-ts/build/spine-threejs.js.map
  31. 1475 1475
      spine-ts/build/spine-webgl.d.ts
  32. 6416 6526
      spine-ts/build/spine-webgl.js
  33. 0 0
      spine-ts/build/spine-webgl.js.map
  34. 165 165
      spine-ts/build/spine-widget.d.ts
  35. 4007 4022
      spine-ts/build/spine-widget.js
  36. 0 0
      spine-ts/build/spine-widget.js.map
  37. 1 1
      spine-ts/core/src/Animation.ts
  38. 5 2
      spine-ts/core/src/AnimationState.ts
  39. 1 1
      spine-ts/core/src/SkeletonJson.ts
  40. 68 6
      spine-unity/Assets/spine-unity/Editor/SpineAttributeDrawers.cs
  41. 1 1
      spine-unity/Assets/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs
  42. 9 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes.meta
  43. 9 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Editor.meta
  44. 47 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Editor/SlotBlendModesEditor.cs
  45. 12 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Editor/SlotBlendModesEditor.cs.meta
  46. 43 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SkeletonPMAMultiply.mat
  47. 9 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SkeletonPMAMultiply.mat.meta
  48. 43 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SkeletonPMAScreen.mat
  49. 9 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SkeletonPMAScreen.mat.meta
  50. 152 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs
  51. 16 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs.meta
  52. 101 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Spine-Skeleton-PMA-Multiply.shader
  53. 9 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Spine-Skeleton-PMA-Multiply.shader.meta
  54. 99 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Spine-Skeleton-PMA-Screen.shader
  55. 9 0
      spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Spine-Skeleton-PMA-Screen.shader.meta

+ 7 - 0
CHANGELOG.md

@@ -15,6 +15,7 @@
   * Added two color tinting support, including `TwoColorTimeline` and additional fields on `Slot` and `SlotData`.
   * Added two color tinting support, including `TwoColorTimeline` and additional fields on `Slot` and `SlotData`.
   * Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
   * Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
   * Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
   * Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
+  * `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
 
 
 ### Starling
 ### Starling
  * Fixed renderer to work with 3.6 changes.
  * Fixed renderer to work with 3.6 changes.
@@ -42,6 +43,7 @@
   * Added macros to define typed dynamic arrays, see `Array.h/.c`
   * Added macros to define typed dynamic arrays, see `Array.h/.c`
   * Added `spClippingAttachment` and respective enum.
   * Added `spClippingAttachment` and respective enum.
   * Added `spSkeletonClipper` and `spTriangulator`, used to implement software clipping of attachments.
   * Added `spSkeletonClipper` and `spTriangulator`, used to implement software clipping of attachments.
+  * `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
 
 
 ### Cocos2d-X
 ### Cocos2d-X
  * Fixed renderer to work with 3.6 changes
  * Fixed renderer to work with 3.6 changes
@@ -71,6 +73,8 @@
 ## C#
 ## C#
  * **Breaking changes**
  * **Breaking changes**
    *  `MeshAttachment.parentMesh` is now a private field to enforce using the `.ParentMesh` setter property in external code. The `MeshAttachment.ParentMesh` property is an appropriate replacement wherever `.parentMesh` was used.
    *  `MeshAttachment.parentMesh` is now a private field to enforce using the `.ParentMesh` setter property in external code. The `MeshAttachment.ParentMesh` property is an appropriate replacement wherever `.parentMesh` was used.
+ * **Additions**
+   * `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
 
 
 ### Unity
 ### Unity
  * Refactored renderer to work with new 3.6 features.
  * Refactored renderer to work with new 3.6 features.
@@ -127,6 +131,7 @@
   * Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
   * Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
   * Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
   * Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
   * Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
   * Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
+  * `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
 
 
 ### libGDX
 ### libGDX
  * Fixed renderer to work with 3.6 changes
  * Fixed renderer to work with 3.6 changes
@@ -147,6 +152,7 @@
   * Added support for local and relative transform constraint calculation, including additional fields in `TransformConstraintData`
   * Added support for local and relative transform constraint calculation, including additional fields in `TransformConstraintData`
   * Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
   * Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
   * Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
   * Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
+  * `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
 
 
 ### Love2D
 ### Love2D
   * Fixed renderer to work with 3.6 changes
   * Fixed renderer to work with 3.6 changes
@@ -171,6 +177,7 @@
   * Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
   * Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
   * Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
   * Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
   * Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
   * Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
+  * `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
 
 
 ### WebGL backend
 ### WebGL backend
  * Fixed WebGL context loss
  * Fixed WebGL context loss

BIN
spine-as3/spine-as3-example/lib/spine-as3.swc


+ 4 - 1
spine-as3/spine-as3/src/spine/animation/AnimationState.as

@@ -147,15 +147,17 @@ package spine.animation {
 			return false;
 			return false;
 		}
 		}
 
 
-		public function apply(skeleton : Skeleton) : void {
+		public function apply(skeleton : Skeleton) : Boolean {
 			if (skeleton == null) throw new ArgumentError("skeleton cannot be null.");
 			if (skeleton == null) throw new ArgumentError("skeleton cannot be null.");
 			if (animationsChanged) _animationsChanged();
 			if (animationsChanged) _animationsChanged();
 
 
 			var events : Vector.<Event> = this.events;
 			var events : Vector.<Event> = this.events;
+			var applied : Boolean = false;
 
 
 			for (var i : int = 0, n : int = tracks.length; i < n; i++) {
 			for (var i : int = 0, n : int = tracks.length; i < n; i++) {
 				var current : TrackEntry = tracks[i];
 				var current : TrackEntry = tracks[i];
 				if (current == null || current.delay > 0) continue;
 				if (current == null || current.delay > 0) continue;
+				applied = true;
 
 
 				// Apply mixing from entries first.
 				// Apply mixing from entries first.
 				var mix : Number = current.alpha;
 				var mix : Number = current.alpha;
@@ -194,6 +196,7 @@ package spine.animation {
 			}
 			}
 
 
 			queue.drain();
 			queue.drain();
+			return applied;
 		}
 		}
 
 
 		private function applyMixingFrom(to : TrackEntry, skeleton : Skeleton) : Number {
 		private function applyMixingFrom(to : TrackEntry, skeleton : Skeleton) : Number {

+ 1 - 1
spine-as3/spine-as3/src/spine/animation/DeformTimeline.as

@@ -72,7 +72,7 @@ package spine.animation {
 			var frameVertices : Vector.<Vector.<Number>> = this.frameVertices;
 			var frameVertices : Vector.<Vector.<Number>> = this.frameVertices;
 			var vertexCount : int = frameVertices[0].length;
 			var vertexCount : int = frameVertices[0].length;
 
 
-			if (verticesArray.length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.
+			if (verticesArray.length != vertexCount && !setupPose) alpha = 1; // Don't mix from uninitialized slot vertices.
 			verticesArray.length = vertexCount;
 			verticesArray.length = vertexCount;
 			var vertices : Vector.<Number> = verticesArray;
 			var vertices : Vector.<Number> = verticesArray;
 
 

+ 1 - 1
spine-c/spine-c/include/spine/AnimationState.h

@@ -120,7 +120,7 @@ spAnimationState* spAnimationState_create (spAnimationStateData* data);
 void spAnimationState_dispose (spAnimationState* self);
 void spAnimationState_dispose (spAnimationState* self);
 
 
 void spAnimationState_update (spAnimationState* self, float delta);
 void spAnimationState_update (spAnimationState* self, float delta);
-void spAnimationState_apply (spAnimationState* self, struct spSkeleton* skeleton);
+int /**bool**/ spAnimationState_apply (spAnimationState* self, struct spSkeleton* skeleton);
 
 
 void spAnimationState_clearTracks (spAnimationState* self);
 void spAnimationState_clearTracks (spAnimationState* self);
 void spAnimationState_clearTrack (spAnimationState* self, int trackIndex);
 void spAnimationState_clearTrack (spAnimationState* self, int trackIndex);

+ 1 - 1
spine-c/spine-c/src/spine/Animation.c

@@ -806,7 +806,7 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
 			slot->attachmentVerticesCapacity = vertexCount;
 			slot->attachmentVerticesCapacity = vertexCount;
 		}
 		}
 	}
 	}
-	if (slot->attachmentVerticesCount != vertexCount) alpha = 1; /* Don't mix from uninitialized slot vertices. */
+	if (slot->attachmentVerticesCount != vertexCount && !setupPose) alpha = 1; /* Don't mix from uninitialized slot vertices. */
 	slot->attachmentVerticesCount = vertexCount;
 	slot->attachmentVerticesCount = vertexCount;
 
 
 	frameVertices = self->frameVertices;
 	frameVertices = self->frameVertices;

+ 4 - 1
spine-c/spine-c/src/spine/AnimationState.c

@@ -327,7 +327,7 @@ int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTr
 	return 0;
 	return 0;
 }
 }
 
 
-void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
+int spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
 	_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
 	_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
 	spTrackEntry* current;
 	spTrackEntry* current;
 	int i, ii, n;
 	int i, ii, n;
@@ -337,6 +337,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
 	int /*boolean*/ firstFrame;
 	int /*boolean*/ firstFrame;
 	float* timelinesRotation;
 	float* timelinesRotation;
 	spTimeline* timeline;
 	spTimeline* timeline;
+	int applied = 0;
 
 
 	if (internal->animationsChanged) _spAnimationState_animationsChanged(self);
 	if (internal->animationsChanged) _spAnimationState_animationsChanged(self);
 
 
@@ -344,6 +345,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
 		float mix;
 		float mix;
 		current = self->tracks[i];
 		current = self->tracks[i];
 		if (!current || current->delay > 0) continue;
 		if (!current || current->delay > 0) continue;
+		applied = -1;
 
 
 		/* Apply mixing from entries first. */
 		/* Apply mixing from entries first. */
 		mix = current->alpha;
 		mix = current->alpha;
@@ -381,6 +383,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
 	}
 	}
 
 
 	_spEventQueue_drain(internal->queue);
 	_spEventQueue_drain(internal->queue);
+	return applied;
 }
 }
 
 
 float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* to, spSkeleton* skeleton) {
 float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* to, spSkeleton* skeleton) {

+ 1 - 1
spine-csharp/src/Animation.cs

@@ -773,7 +773,7 @@ namespace Spine {
 			float[][] frameVertices = this.frameVertices;
 			float[][] frameVertices = this.frameVertices;
 			int vertexCount = frameVertices[0].Length;
 			int vertexCount = frameVertices[0].Length;
 
 
-			if (verticesArray.Count != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.
+			if (verticesArray.Count != vertexCount && !setupPose) alpha = 1; // Don't mix from uninitialized slot vertices.
 			// verticesArray.SetSize(vertexCount) // Ensure size and preemptively set count.
 			// verticesArray.SetSize(vertexCount) // Ensure size and preemptively set count.
 			if (verticesArray.Capacity < vertexCount) verticesArray.Capacity = vertexCount;
 			if (verticesArray.Capacity < vertexCount) verticesArray.Capacity = vertexCount;
 			verticesArray.Count = vertexCount;
 			verticesArray.Count = vertexCount;

+ 4 - 1
spine-csharp/src/AnimationState.cs

@@ -159,16 +159,18 @@ namespace Spine {
 		/// <summary>
 		/// <summary>
 		/// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the 
 		/// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the 
 		/// animation state can be applied to multiple skeletons to pose them identically.</summary>
 		/// animation state can be applied to multiple skeletons to pose them identically.</summary>
-		public void Apply (Skeleton skeleton) {
+		public bool Apply (Skeleton skeleton) {
 			if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null.");
 			if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null.");
 			if (animationsChanged) AnimationsChanged();
 			if (animationsChanged) AnimationsChanged();
 
 
 			var events = this.events;
 			var events = this.events;
 
 
+			bool applied = false;
 			var tracksItems = tracks.Items;
 			var tracksItems = tracks.Items;
 			for (int i = 0, m = tracks.Count; i < m; i++) {
 			for (int i = 0, m = tracks.Count; i < m; i++) {
 				TrackEntry current = tracksItems[i];
 				TrackEntry current = tracksItems[i];
 				if (current == null || current.delay > 0) continue;
 				if (current == null || current.delay > 0) continue;
+				applied = true;
 
 
 				// Apply mixing from entries first.
 				// Apply mixing from entries first.
 				float mix = current.alpha;
 				float mix = current.alpha;
@@ -210,6 +212,7 @@ namespace Spine {
 			}
 			}
 
 
 			queue.Drain();
 			queue.Drain();
+			return applied;
 		}
 		}
 
 
 		private float ApplyMixingFrom (TrackEntry to, Skeleton skeleton) {
 		private float ApplyMixingFrom (TrackEntry to, Skeleton skeleton) {

+ 2 - 2
spine-csharp/src/Attachments/MeshAttachment.cs

@@ -52,8 +52,8 @@ namespace Spine {
 		public float B { get { return b; } set { b = value; } }
 		public float B { get { return b; } set { b = value; } }
 		public float A { get { return a; } set { a = value; } }
 		public float A { get { return a; } set { a = value; } }
 
 
-		public String Path { get; set; }
-		public Object RendererObject { get; set; }
+		public string Path { get; set; }
+		public object RendererObject; //public Object RendererObject { get; set; }
 		public float RegionU { get; set; }
 		public float RegionU { get; set; }
 		public float RegionV { get; set; }
 		public float RegionV { get; set; }
 		public float RegionU2 { get; set; }
 		public float RegionU2 { get; set; }

+ 2 - 2
spine-csharp/src/Attachments/PointAttachment.cs

@@ -46,8 +46,8 @@ namespace Spine {
 			: base(name) {
 			: base(name) {
 		}
 		}
 
 
-		public void ComputeWorldPosition (Bone bone, float x, float y, out float ox, out float oy) {
-			bone.LocalToWorld(x, y, out ox, out oy);
+		public void ComputeWorldPosition (Bone bone, out float ox, out float oy) {
+			bone.LocalToWorld(this.x, this.y, out ox, out oy);
 		}
 		}
 
 
 		public float ComputeWorldRotation (Bone bone) {
 		public float ComputeWorldRotation (Bone bone) {

+ 1 - 1
spine-csharp/src/Attachments/RegionAttachment.cs

@@ -61,7 +61,7 @@ namespace Spine {
 		public float A { get { return a; } set { a = value; } }
 		public float A { get { return a; } set { a = value; } }
 
 
 		public string Path { get; set; }
 		public string Path { get; set; }
-		public object RendererObject { get; set; }
+		public object RendererObject; //public object RendererObject { get; set; }
 		public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } }
 		public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } }
 		public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated.
 		public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated.
 		public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } }
 		public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } }

+ 1 - 1
spine-csharp/src/Attachments/VertexAttachment.cs

@@ -57,7 +57,7 @@ namespace Spine {
 		/// <param name="stride">The number of <paramref name="worldVertices"/> entries between the value pairs written.</param>
 		/// <param name="stride">The number of <paramref name="worldVertices"/> entries between the value pairs written.</param>
 		public void ComputeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset, int stride = 2) {
 		public void ComputeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset, int stride = 2) {
 			count = offset + (count >> 1) * stride;
 			count = offset + (count >> 1) * stride;
-			Skeleton skeleton = slot.Skeleton;
+			Skeleton skeleton = slot.bone.skeleton;
 			var deformArray = slot.attachmentVertices;
 			var deformArray = slot.attachmentVertices;
 			float[] vertices = this.vertices;
 			float[] vertices = this.vertices;
 			int[] bones = this.bones;
 			int[] bones = this.bones;

+ 1 - 1
spine-csharp/src/IkConstraint.cs

@@ -183,7 +183,7 @@ namespace Spine {
 				float maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;
 				float maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;
 				c = -a * l1 / (aa - bb);
 				c = -a * l1 / (aa - bb);
 				if (c >= -1 && c <= 1) {
 				if (c >= -1 && c <= 1) {
-					float angle = (float)Math.Acos(c);
+					c = (float)Math.Acos(c);
 					x = a * (float)Math.Cos(c) + l1;
 					x = a * (float)Math.Cos(c) + l1;
 					y = b * (float)Math.Sin(c);
 					y = b * (float)Math.Sin(c);
 					d = x * x + y * y;
 					d = x * x + y * y;

+ 1 - 1
spine-lua/Animation.lua

@@ -769,7 +769,7 @@ function Animation.DeformTimeline.new (frameCount)
 		local frameVertices = self.frameVertices
 		local frameVertices = self.frameVertices
 		local vertexCount = #(frameVertices[0])
 		local vertexCount = #(frameVertices[0])
 
 
-		if (#verticesArray ~= vertexCount) then alpha = 1 end -- Don't mix from uninitialized slot vertices.
+		if (#verticesArray ~= vertexCount and not setupPose) then alpha = 1 end -- Don't mix from uninitialized slot vertices.
 		local vertices = utils.setArraySize(verticesArray, vertexCount)
 		local vertices = utils.setArraySize(verticesArray, vertexCount)
 
 
 		if time >= frames[zlen(frames) - 1] then -- Time is after last frame.
 		if time >= frames[zlen(frames) - 1] then -- Time is after last frame.

+ 3 - 0
spine-lua/AnimationState.lua

@@ -366,9 +366,11 @@ function AnimationState:apply (skeleton)
 	local events = self.events
 	local events = self.events
 	local tracks = self.tracks
 	local tracks = self.tracks
 	local queue = self.queue
 	local queue = self.queue
+  local applied = false
 
 
 	for i,current in pairs(tracks) do
 	for i,current in pairs(tracks) do
 		if not (current == nil or current.delay > 0) then
 		if not (current == nil or current.delay > 0) then
+      applied = true
 			-- Apply mixing from entries first.
 			-- Apply mixing from entries first.
 			local mix = current.alpha
 			local mix = current.alpha
 			if current.mixingFrom then 
 			if current.mixingFrom then 
@@ -407,6 +409,7 @@ function AnimationState:apply (skeleton)
 	end
 	end
 
 
 	queue:drain()
 	queue:drain()
+  return applied
 end
 end
 
 
 function AnimationState:applyMixingFrom (to, skeleton)
 function AnimationState:applyMixingFrom (to, skeleton)

BIN
spine-starling/spine-starling-example/lib/spine-as3.swc


BIN
spine-starling/spine-starling/lib/spine-as3.swc


+ 301 - 301
spine-ts/build/spine-all.d.ts

@@ -1,3 +1,97 @@
+declare module spine {
+	class AssetManager implements Disposable {
+		private pathPrefix;
+		private textureLoader;
+		private assets;
+		private errors;
+		private toLoad;
+		private loaded;
+		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
+		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
+		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
+		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
+		get(path: string): any;
+		remove(path: string): void;
+		removeAll(): void;
+		isLoadingComplete(): boolean;
+		getToLoad(): number;
+		getLoaded(): number;
+		dispose(): void;
+		hasErrors(): boolean;
+		getErrors(): Map<string>;
+	}
+}
+declare module spine.canvas {
+	class AssetManager extends spine.AssetManager {
+		constructor(pathPrefix?: string);
+	}
+}
+declare module spine {
+	abstract class Texture {
+		protected _image: HTMLImageElement;
+		constructor(image: HTMLImageElement);
+		getImage(): HTMLImageElement;
+		abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
+		abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
+		abstract dispose(): void;
+		static filterFromString(text: string): TextureFilter;
+		static wrapFromString(text: string): TextureWrap;
+	}
+	enum TextureFilter {
+		Nearest = 9728,
+		Linear = 9729,
+		MipMap = 9987,
+		MipMapNearestNearest = 9984,
+		MipMapLinearNearest = 9985,
+		MipMapNearestLinear = 9986,
+		MipMapLinearLinear = 9987,
+	}
+	enum TextureWrap {
+		MirroredRepeat = 33648,
+		ClampToEdge = 33071,
+		Repeat = 10497,
+	}
+	class TextureRegion {
+		renderObject: any;
+		u: number;
+		v: number;
+		u2: number;
+		v2: number;
+		width: number;
+		height: number;
+		rotate: boolean;
+		offsetX: number;
+		offsetY: number;
+		originalWidth: number;
+		originalHeight: number;
+	}
+}
+declare module spine.canvas {
+	class CanvasTexture extends Texture {
+		constructor(image: HTMLImageElement);
+		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
+		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
+		dispose(): void;
+	}
+}
+declare module spine.canvas {
+	class SkeletonRenderer {
+		static QUAD_TRIANGLES: number[];
+		static VERTEX_SIZE: number;
+		private ctx;
+		triangleRendering: boolean;
+		debugRendering: boolean;
+		private vertices;
+		private tempColor;
+		constructor(context: CanvasRenderingContext2D);
+		draw(skeleton: Skeleton): void;
+		private drawImages(skeleton);
+		private drawTriangles(skeleton);
+		private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
+		private computeRegionVertices(slot, region, pma);
+		private computeMeshVertices(slot, mesh, pma);
+	}
+}
 declare module spine {
 declare module spine {
 	class Animation {
 	class Animation {
 		name: string;
 		name: string;
@@ -245,7 +339,7 @@ declare module spine {
 		constructor(data: AnimationStateData);
 		constructor(data: AnimationStateData);
 		update(delta: number): void;
 		update(delta: number): void;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
-		apply(skeleton: Skeleton): void;
+		apply(skeleton: Skeleton): boolean;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
@@ -355,29 +449,6 @@ declare module spine {
 		getMix(from: Animation, to: Animation): number;
 		getMix(from: Animation, to: Animation): number;
 	}
 	}
 }
 }
-declare module spine {
-	class AssetManager implements Disposable {
-		private pathPrefix;
-		private textureLoader;
-		private assets;
-		private errors;
-		private toLoad;
-		private loaded;
-		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
-		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
-		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
-		get(path: string): any;
-		remove(path: string): void;
-		removeAll(): void;
-		isLoadingComplete(): boolean;
-		getToLoad(): number;
-		getLoaded(): number;
-		dispose(): void;
-		hasErrors(): boolean;
-		getErrors(): Map<string>;
-	}
-}
 declare module spine {
 declare module spine {
 	class AtlasAttachmentLoader implements AttachmentLoader {
 	class AtlasAttachmentLoader implements AttachmentLoader {
 		atlas: TextureAtlas;
 		atlas: TextureAtlas;
@@ -390,6 +461,154 @@ declare module spine {
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+		newPointAttachment(skin: Skin, name: string): PointAttachment;
+		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+		Point = 5,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class ClippingAttachment extends VertexAttachment {
+		endSlot: SlotData;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class PointAttachment extends VertexAttachment {
+		x: number;
+		y: number;
+		rotation: number;
+		color: Color;
+		constructor(name: string);
+		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
+		computeWorldRotation(bone: Bone): number;
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		updateOffset(): void;
+		setRegion(region: TextureRegion): void;
+		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -766,53 +985,13 @@ declare module spine {
 declare module spine {
 declare module spine {
 	class SlotData {
 	class SlotData {
 		index: number;
 		index: number;
-		name: string;
-		boneData: BoneData;
-		color: Color;
-		darkColor: Color;
-		attachmentName: string;
-		blendMode: BlendMode;
-		constructor(index: number, name: string, boneData: BoneData);
-	}
-}
-declare module spine {
-	abstract class Texture {
-		protected _image: HTMLImageElement;
-		constructor(image: HTMLImageElement);
-		getImage(): HTMLImageElement;
-		abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-		abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
-		abstract dispose(): void;
-		static filterFromString(text: string): TextureFilter;
-		static wrapFromString(text: string): TextureWrap;
-	}
-	enum TextureFilter {
-		Nearest = 9728,
-		Linear = 9729,
-		MipMap = 9987,
-		MipMapNearestNearest = 9984,
-		MipMapLinearNearest = 9985,
-		MipMapNearestLinear = 9986,
-		MipMapLinearLinear = 9987,
-	}
-	enum TextureWrap {
-		MirroredRepeat = 33648,
-		ClampToEdge = 33071,
-		Repeat = 10497,
-	}
-	class TextureRegion {
-		renderObject: any;
-		u: number;
-		v: number;
-		u2: number;
-		v2: number;
-		width: number;
-		height: number;
-		rotate: boolean;
-		offsetX: number;
-		offsetY: number;
-		originalWidth: number;
-		originalHeight: number;
+		name: string;
+		boneData: BoneData;
+		color: Color;
+		darkColor: Color;
+		attachmentName: string;
+		blendMode: BlendMode;
+		constructor(index: number, name: string, boneData: BoneData);
 	}
 	}
 }
 }
 declare module spine {
 declare module spine {
@@ -1010,183 +1189,51 @@ declare module spine {
 		getMean(): number;
 		getMean(): number;
 	}
 	}
 }
 }
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-		newPointAttachment(skin: Skin, name: string): PointAttachment;
-		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-		Point = 5,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class ClippingAttachment extends VertexAttachment {
-		endSlot: SlotData;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class PointAttachment extends VertexAttachment {
-		x: number;
-		y: number;
-		rotation: number;
-		color: Color;
-		constructor(name: string);
-		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
-		computeWorldRotation(bone: Bone): number;
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		updateOffset(): void;
-		setRegion(region: TextureRegion): void;
-		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-	}
-}
-declare module spine.canvas {
+declare module spine.threejs {
 	class AssetManager extends spine.AssetManager {
 	class AssetManager extends spine.AssetManager {
 		constructor(pathPrefix?: string);
 		constructor(pathPrefix?: string);
 	}
 	}
 }
 }
-declare module spine.canvas {
-	class CanvasTexture extends Texture {
-		constructor(image: HTMLImageElement);
-		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
-		dispose(): void;
+declare module spine.threejs {
+	class MeshBatcher {
+		mesh: THREE.Mesh;
+		private static VERTEX_SIZE;
+		private vertexBuffer;
+		private vertices;
+		private verticesLength;
+		private indices;
+		private indicesLength;
+		constructor(mesh: THREE.Mesh, maxVertices?: number);
+		begin(): void;
+		batch(vertices: ArrayLike<number>, verticesLength: number, indices: ArrayLike<number>, indicesLength: number, z?: number): void;
+		end(): void;
 	}
 	}
 }
 }
-declare module spine.canvas {
-	class SkeletonRenderer {
+declare module spine.threejs {
+	class SkeletonMesh extends THREE.Mesh {
+		skeleton: Skeleton;
+		state: AnimationState;
+		zOffset: number;
+		private batcher;
+		private clipper;
 		static QUAD_TRIANGLES: number[];
 		static QUAD_TRIANGLES: number[];
 		static VERTEX_SIZE: number;
 		static VERTEX_SIZE: number;
-		private ctx;
-		triangleRendering: boolean;
-		debugRendering: boolean;
 		private vertices;
 		private vertices;
 		private tempColor;
 		private tempColor;
-		constructor(context: CanvasRenderingContext2D);
-		draw(skeleton: Skeleton): void;
-		private drawImages(skeleton);
-		private drawTriangles(skeleton);
-		private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
-		private computeRegionVertices(slot, region, pma);
-		private computeMeshVertices(slot, mesh, pma);
+		constructor(skeletonData: SkeletonData);
+		update(deltaTime: number): void;
+		private updateGeometry();
+	}
+}
+declare module spine.threejs {
+	class ThreeJsTexture extends Texture {
+		texture: THREE.Texture;
+		constructor(image: HTMLImageElement);
+		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
+		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
+		dispose(): void;
+		static toThreeJsTextureFilter(filter: TextureFilter): THREE.TextureFilter;
+		static toThreeJsTextureWrap(wrap: TextureWrap): THREE.Wrapping;
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
@@ -1280,22 +1327,22 @@ declare module spine.webgl {
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-	const M00 = 0;
-	const M01 = 4;
-	const M02 = 8;
-	const M03 = 12;
-	const M10 = 1;
-	const M11 = 5;
-	const M12 = 9;
-	const M13 = 13;
-	const M20 = 2;
-	const M21 = 6;
-	const M22 = 10;
-	const M23 = 14;
-	const M30 = 3;
-	const M31 = 7;
-	const M32 = 11;
-	const M33 = 15;
+	const M00: number;
+	const M01: number;
+	const M02: number;
+	const M03: number;
+	const M10: number;
+	const M11: number;
+	const M12: number;
+	const M13: number;
+	const M20: number;
+	const M21: number;
+	const M22: number;
+	const M23: number;
+	const M30: number;
+	const M31: number;
+	const M32: number;
+	const M33: number;
 	class Matrix4 {
 	class Matrix4 {
 		temp: Float32Array;
 		temp: Float32Array;
 		values: Float32Array;
 		values: Float32Array;
@@ -1614,53 +1661,6 @@ declare module spine.webgl {
 		static getSourceGLBlendMode(blendMode: BlendMode, premultipliedAlpha?: boolean): number;
 		static getSourceGLBlendMode(blendMode: BlendMode, premultipliedAlpha?: boolean): number;
 	}
 	}
 }
 }
-declare module spine.threejs {
-	class AssetManager extends spine.AssetManager {
-		constructor(pathPrefix?: string);
-	}
-}
-declare module spine.threejs {
-	class MeshBatcher {
-		mesh: THREE.Mesh;
-		private static VERTEX_SIZE;
-		private vertexBuffer;
-		private vertices;
-		private verticesLength;
-		private indices;
-		private indicesLength;
-		constructor(mesh: THREE.Mesh, maxVertices?: number);
-		begin(): void;
-		batch(vertices: ArrayLike<number>, verticesLength: number, indices: ArrayLike<number>, indicesLength: number, z?: number): void;
-		end(): void;
-	}
-}
-declare module spine.threejs {
-	class SkeletonMesh extends THREE.Mesh {
-		skeleton: Skeleton;
-		state: AnimationState;
-		zOffset: number;
-		private batcher;
-		private clipper;
-		static QUAD_TRIANGLES: number[];
-		static VERTEX_SIZE: number;
-		private vertices;
-		private tempColor;
-		constructor(skeletonData: SkeletonData);
-		update(deltaTime: number): void;
-		private updateGeometry();
-	}
-}
-declare module spine.threejs {
-	class ThreeJsTexture extends Texture {
-		texture: THREE.Texture;
-		constructor(image: HTMLImageElement);
-		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
-		dispose(): void;
-		static toThreeJsTextureFilter(filter: TextureFilter): THREE.TextureFilter;
-		static toThreeJsTextureWrap(wrap: TextureWrap): THREE.Wrapping;
-	}
-}
 declare module spine {
 declare module spine {
 	class SpineWidget {
 	class SpineWidget {
 		skeleton: Skeleton;
 		skeleton: Skeleton;

Diff do ficheiro suprimidas por serem muito extensas
+ 997 - 332
spine-ts/build/spine-all.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
spine-ts/build/spine-all.js.map


+ 243 - 243
spine-ts/build/spine-canvas.d.ts

@@ -1,3 +1,97 @@
+declare module spine {
+	class AssetManager implements Disposable {
+		private pathPrefix;
+		private textureLoader;
+		private assets;
+		private errors;
+		private toLoad;
+		private loaded;
+		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
+		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
+		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
+		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
+		get(path: string): any;
+		remove(path: string): void;
+		removeAll(): void;
+		isLoadingComplete(): boolean;
+		getToLoad(): number;
+		getLoaded(): number;
+		dispose(): void;
+		hasErrors(): boolean;
+		getErrors(): Map<string>;
+	}
+}
+declare module spine.canvas {
+	class AssetManager extends spine.AssetManager {
+		constructor(pathPrefix?: string);
+	}
+}
+declare module spine {
+	abstract class Texture {
+		protected _image: HTMLImageElement;
+		constructor(image: HTMLImageElement);
+		getImage(): HTMLImageElement;
+		abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
+		abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
+		abstract dispose(): void;
+		static filterFromString(text: string): TextureFilter;
+		static wrapFromString(text: string): TextureWrap;
+	}
+	enum TextureFilter {
+		Nearest = 9728,
+		Linear = 9729,
+		MipMap = 9987,
+		MipMapNearestNearest = 9984,
+		MipMapLinearNearest = 9985,
+		MipMapNearestLinear = 9986,
+		MipMapLinearLinear = 9987,
+	}
+	enum TextureWrap {
+		MirroredRepeat = 33648,
+		ClampToEdge = 33071,
+		Repeat = 10497,
+	}
+	class TextureRegion {
+		renderObject: any;
+		u: number;
+		v: number;
+		u2: number;
+		v2: number;
+		width: number;
+		height: number;
+		rotate: boolean;
+		offsetX: number;
+		offsetY: number;
+		originalWidth: number;
+		originalHeight: number;
+	}
+}
+declare module spine.canvas {
+	class CanvasTexture extends Texture {
+		constructor(image: HTMLImageElement);
+		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
+		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
+		dispose(): void;
+	}
+}
+declare module spine.canvas {
+	class SkeletonRenderer {
+		static QUAD_TRIANGLES: number[];
+		static VERTEX_SIZE: number;
+		private ctx;
+		triangleRendering: boolean;
+		debugRendering: boolean;
+		private vertices;
+		private tempColor;
+		constructor(context: CanvasRenderingContext2D);
+		draw(skeleton: Skeleton): void;
+		private drawImages(skeleton);
+		private drawTriangles(skeleton);
+		private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
+		private computeRegionVertices(slot, region, pma);
+		private computeMeshVertices(slot, mesh, pma);
+	}
+}
 declare module spine {
 declare module spine {
 	class Animation {
 	class Animation {
 		name: string;
 		name: string;
@@ -245,7 +339,7 @@ declare module spine {
 		constructor(data: AnimationStateData);
 		constructor(data: AnimationStateData);
 		update(delta: number): void;
 		update(delta: number): void;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
-		apply(skeleton: Skeleton): void;
+		apply(skeleton: Skeleton): boolean;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
@@ -355,29 +449,6 @@ declare module spine {
 		getMix(from: Animation, to: Animation): number;
 		getMix(from: Animation, to: Animation): number;
 	}
 	}
 }
 }
-declare module spine {
-	class AssetManager implements Disposable {
-		private pathPrefix;
-		private textureLoader;
-		private assets;
-		private errors;
-		private toLoad;
-		private loaded;
-		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
-		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
-		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
-		get(path: string): any;
-		remove(path: string): void;
-		removeAll(): void;
-		isLoadingComplete(): boolean;
-		getToLoad(): number;
-		getLoaded(): number;
-		dispose(): void;
-		hasErrors(): boolean;
-		getErrors(): Map<string>;
-	}
-}
 declare module spine {
 declare module spine {
 	class AtlasAttachmentLoader implements AttachmentLoader {
 	class AtlasAttachmentLoader implements AttachmentLoader {
 		atlas: TextureAtlas;
 		atlas: TextureAtlas;
@@ -390,6 +461,154 @@ declare module spine {
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+		newPointAttachment(skin: Skin, name: string): PointAttachment;
+		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+		Point = 5,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class ClippingAttachment extends VertexAttachment {
+		endSlot: SlotData;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class PointAttachment extends VertexAttachment {
+		x: number;
+		y: number;
+		rotation: number;
+		color: Color;
+		constructor(name: string);
+		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
+		computeWorldRotation(bone: Bone): number;
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		updateOffset(): void;
+		setRegion(region: TextureRegion): void;
+		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -775,46 +994,6 @@ declare module spine {
 		constructor(index: number, name: string, boneData: BoneData);
 		constructor(index: number, name: string, boneData: BoneData);
 	}
 	}
 }
 }
-declare module spine {
-	abstract class Texture {
-		protected _image: HTMLImageElement;
-		constructor(image: HTMLImageElement);
-		getImage(): HTMLImageElement;
-		abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-		abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
-		abstract dispose(): void;
-		static filterFromString(text: string): TextureFilter;
-		static wrapFromString(text: string): TextureWrap;
-	}
-	enum TextureFilter {
-		Nearest = 9728,
-		Linear = 9729,
-		MipMap = 9987,
-		MipMapNearestNearest = 9984,
-		MipMapLinearNearest = 9985,
-		MipMapNearestLinear = 9986,
-		MipMapLinearLinear = 9987,
-	}
-	enum TextureWrap {
-		MirroredRepeat = 33648,
-		ClampToEdge = 33071,
-		Repeat = 10497,
-	}
-	class TextureRegion {
-		renderObject: any;
-		u: number;
-		v: number;
-		u2: number;
-		v2: number;
-		width: number;
-		height: number;
-		rotate: boolean;
-		offsetX: number;
-		offsetY: number;
-		originalWidth: number;
-		originalHeight: number;
-	}
-}
 declare module spine {
 declare module spine {
 	class TextureAtlas implements Disposable {
 	class TextureAtlas implements Disposable {
 		pages: TextureAtlasPage[];
 		pages: TextureAtlasPage[];
@@ -1010,182 +1189,3 @@ declare module spine {
 		getMean(): number;
 		getMean(): number;
 	}
 	}
 }
 }
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-		newPointAttachment(skin: Skin, name: string): PointAttachment;
-		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-		Point = 5,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class ClippingAttachment extends VertexAttachment {
-		endSlot: SlotData;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class PointAttachment extends VertexAttachment {
-		x: number;
-		y: number;
-		rotation: number;
-		color: Color;
-		constructor(name: string);
-		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
-		computeWorldRotation(bone: Bone): number;
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		updateOffset(): void;
-		setRegion(region: TextureRegion): void;
-		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-	}
-}
-declare module spine.canvas {
-	class AssetManager extends spine.AssetManager {
-		constructor(pathPrefix?: string);
-	}
-}
-declare module spine.canvas {
-	class CanvasTexture extends Texture {
-		constructor(image: HTMLImageElement);
-		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
-		dispose(): void;
-	}
-}
-declare module spine.canvas {
-	class SkeletonRenderer {
-		static QUAD_TRIANGLES: number[];
-		static VERTEX_SIZE: number;
-		private ctx;
-		triangleRendering: boolean;
-		debugRendering: boolean;
-		private vertices;
-		private tempColor;
-		constructor(context: CanvasRenderingContext2D);
-		draw(skeleton: Skeleton): void;
-		private drawImages(skeleton);
-		private drawTriangles(skeleton);
-		private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
-		private computeRegionVertices(slot, region, pma);
-		private computeMeshVertices(slot, mesh, pma);
-	}
-}

Diff do ficheiro suprimidas por serem muito extensas
+ 779 - 338
spine-ts/build/spine-canvas.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
spine-ts/build/spine-canvas.js.map


+ 149 - 149
spine-ts/build/spine-core.d.ts

@@ -245,7 +245,7 @@ declare module spine {
 		constructor(data: AnimationStateData);
 		constructor(data: AnimationStateData);
 		update(delta: number): void;
 		update(delta: number): void;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
-		apply(skeleton: Skeleton): void;
+		apply(skeleton: Skeleton): boolean;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
@@ -390,6 +390,154 @@ declare module spine {
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+		newPointAttachment(skin: Skin, name: string): PointAttachment;
+		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+		Point = 5,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class ClippingAttachment extends VertexAttachment {
+		endSlot: SlotData;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class PointAttachment extends VertexAttachment {
+		x: number;
+		y: number;
+		rotation: number;
+		color: Color;
+		constructor(name: string);
+		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
+		computeWorldRotation(bone: Bone): number;
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		updateOffset(): void;
+		setRegion(region: TextureRegion): void;
+		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -1010,151 +1158,3 @@ declare module spine {
 		getMean(): number;
 		getMean(): number;
 	}
 	}
 }
 }
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-		newPointAttachment(skin: Skin, name: string): PointAttachment;
-		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-		Point = 5,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class ClippingAttachment extends VertexAttachment {
-		endSlot: SlotData;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class PointAttachment extends VertexAttachment {
-		x: number;
-		y: number;
-		rotation: number;
-		color: Color;
-		constructor(name: string);
-		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
-		computeWorldRotation(bone: Bone): number;
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		updateOffset(): void;
-		setRegion(region: TextureRegion): void;
-		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-	}
-}

+ 4007 - 4022
spine-ts/build/spine-core.js

@@ -1,13 +1,8 @@
-var __extends = (this && this.__extends) || (function () {
-	var extendStatics = Object.setPrototypeOf ||
-		({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-		function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-	return function (d, b) {
-		extendStatics(d, b);
-		function __() { this.constructor = d; }
-		d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-	};
-})();
+var __extends = (this && this.__extends) || function (d, b) {
+	for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+	function __() { this.constructor = d; }
+	d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
 	var Animation = (function () {
 	var Animation = (function () {
@@ -58,7 +53,6 @@ var spine;
 		return Animation;
 		return Animation;
 	}());
 	}());
 	spine.Animation = Animation;
 	spine.Animation = Animation;
-	var TimelineType;
 	(function (TimelineType) {
 	(function (TimelineType) {
 		TimelineType[TimelineType["rotate"] = 0] = "rotate";
 		TimelineType[TimelineType["rotate"] = 0] = "rotate";
 		TimelineType[TimelineType["translate"] = 1] = "translate";
 		TimelineType[TimelineType["translate"] = 1] = "translate";
@@ -75,7 +69,8 @@ var spine;
 		TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing";
 		TimelineType[TimelineType["pathConstraintSpacing"] = 12] = "pathConstraintSpacing";
 		TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix";
 		TimelineType[TimelineType["pathConstraintMix"] = 13] = "pathConstraintMix";
 		TimelineType[TimelineType["twoColor"] = 14] = "twoColor";
 		TimelineType[TimelineType["twoColor"] = 14] = "twoColor";
-	})(TimelineType = spine.TimelineType || (spine.TimelineType = {}));
+	})(spine.TimelineType || (spine.TimelineType = {}));
+	var TimelineType = spine.TimelineType;
 	var CurveTimeline = (function () {
 	var CurveTimeline = (function () {
 		function CurveTimeline(frameCount) {
 		function CurveTimeline(frameCount) {
 			if (frameCount <= 0)
 			if (frameCount <= 0)
@@ -151,19 +146,18 @@ var spine;
 			var y = curves[i - 1];
 			var y = curves[i - 1];
 			return y + (1 - y) * (percent - x) / (1 - x);
 			return y + (1 - y) * (percent - x) / (1 - x);
 		};
 		};
+		CurveTimeline.LINEAR = 0;
+		CurveTimeline.STEPPED = 1;
+		CurveTimeline.BEZIER = 2;
+		CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;
 		return CurveTimeline;
 		return CurveTimeline;
 	}());
 	}());
-	CurveTimeline.LINEAR = 0;
-	CurveTimeline.STEPPED = 1;
-	CurveTimeline.BEZIER = 2;
-	CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;
 	spine.CurveTimeline = CurveTimeline;
 	spine.CurveTimeline = CurveTimeline;
 	var RotateTimeline = (function (_super) {
 	var RotateTimeline = (function (_super) {
 		__extends(RotateTimeline, _super);
 		__extends(RotateTimeline, _super);
 		function RotateTimeline(frameCount) {
 		function RotateTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount << 1);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount << 1);
 		}
 		}
 		RotateTimeline.prototype.getPropertyId = function () {
 		RotateTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.rotate << 24) + this.boneIndex;
 			return (TimelineType.rotate << 24) + this.boneIndex;
@@ -208,19 +202,18 @@ var spine;
 				bone.rotation += r * alpha;
 				bone.rotation += r * alpha;
 			}
 			}
 		};
 		};
+		RotateTimeline.ENTRIES = 2;
+		RotateTimeline.PREV_TIME = -2;
+		RotateTimeline.PREV_ROTATION = -1;
+		RotateTimeline.ROTATION = 1;
 		return RotateTimeline;
 		return RotateTimeline;
 	}(CurveTimeline));
 	}(CurveTimeline));
-	RotateTimeline.ENTRIES = 2;
-	RotateTimeline.PREV_TIME = -2;
-	RotateTimeline.PREV_ROTATION = -1;
-	RotateTimeline.ROTATION = 1;
 	spine.RotateTimeline = RotateTimeline;
 	spine.RotateTimeline = RotateTimeline;
 	var TranslateTimeline = (function (_super) {
 	var TranslateTimeline = (function (_super) {
 		__extends(TranslateTimeline, _super);
 		__extends(TranslateTimeline, _super);
 		function TranslateTimeline(frameCount) {
 		function TranslateTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);
 		}
 		}
 		TranslateTimeline.prototype.getPropertyId = function () {
 		TranslateTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.translate << 24) + this.boneIndex;
 			return (TimelineType.translate << 24) + this.boneIndex;
@@ -264,19 +257,19 @@ var spine;
 				bone.y += (bone.data.y + y - bone.y) * alpha;
 				bone.y += (bone.data.y + y - bone.y) * alpha;
 			}
 			}
 		};
 		};
+		TranslateTimeline.ENTRIES = 3;
+		TranslateTimeline.PREV_TIME = -3;
+		TranslateTimeline.PREV_X = -2;
+		TranslateTimeline.PREV_Y = -1;
+		TranslateTimeline.X = 1;
+		TranslateTimeline.Y = 2;
 		return TranslateTimeline;
 		return TranslateTimeline;
 	}(CurveTimeline));
 	}(CurveTimeline));
-	TranslateTimeline.ENTRIES = 3;
-	TranslateTimeline.PREV_TIME = -3;
-	TranslateTimeline.PREV_X = -2;
-	TranslateTimeline.PREV_Y = -1;
-	TranslateTimeline.X = 1;
-	TranslateTimeline.Y = 2;
 	spine.TranslateTimeline = TranslateTimeline;
 	spine.TranslateTimeline = TranslateTimeline;
 	var ScaleTimeline = (function (_super) {
 	var ScaleTimeline = (function (_super) {
 		__extends(ScaleTimeline, _super);
 		__extends(ScaleTimeline, _super);
 		function ScaleTimeline(frameCount) {
 		function ScaleTimeline(frameCount) {
-			return _super.call(this, frameCount) || this;
+			_super.call(this, frameCount);
 		}
 		}
 		ScaleTimeline.prototype.getPropertyId = function () {
 		ScaleTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.scale << 24) + this.boneIndex;
 			return (TimelineType.scale << 24) + this.boneIndex;
@@ -337,7 +330,7 @@ var spine;
 	var ShearTimeline = (function (_super) {
 	var ShearTimeline = (function (_super) {
 		__extends(ShearTimeline, _super);
 		__extends(ShearTimeline, _super);
 		function ShearTimeline(frameCount) {
 		function ShearTimeline(frameCount) {
-			return _super.call(this, frameCount) || this;
+			_super.call(this, frameCount);
 		}
 		}
 		ShearTimeline.prototype.getPropertyId = function () {
 		ShearTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.shear << 24) + this.boneIndex;
 			return (TimelineType.shear << 24) + this.boneIndex;
@@ -381,9 +374,8 @@ var spine;
 	var ColorTimeline = (function (_super) {
 	var ColorTimeline = (function (_super) {
 		__extends(ColorTimeline, _super);
 		__extends(ColorTimeline, _super);
 		function ColorTimeline(frameCount) {
 		function ColorTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);
 		}
 		}
 		ColorTimeline.prototype.getPropertyId = function () {
 		ColorTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.color << 24) + this.slotIndex;
 			return (TimelineType.color << 24) + this.slotIndex;
@@ -434,25 +426,24 @@ var spine;
 				color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);
 				color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);
 			}
 			}
 		};
 		};
+		ColorTimeline.ENTRIES = 5;
+		ColorTimeline.PREV_TIME = -5;
+		ColorTimeline.PREV_R = -4;
+		ColorTimeline.PREV_G = -3;
+		ColorTimeline.PREV_B = -2;
+		ColorTimeline.PREV_A = -1;
+		ColorTimeline.R = 1;
+		ColorTimeline.G = 2;
+		ColorTimeline.B = 3;
+		ColorTimeline.A = 4;
 		return ColorTimeline;
 		return ColorTimeline;
 	}(CurveTimeline));
 	}(CurveTimeline));
-	ColorTimeline.ENTRIES = 5;
-	ColorTimeline.PREV_TIME = -5;
-	ColorTimeline.PREV_R = -4;
-	ColorTimeline.PREV_G = -3;
-	ColorTimeline.PREV_B = -2;
-	ColorTimeline.PREV_A = -1;
-	ColorTimeline.R = 1;
-	ColorTimeline.G = 2;
-	ColorTimeline.B = 3;
-	ColorTimeline.A = 4;
 	spine.ColorTimeline = ColorTimeline;
 	spine.ColorTimeline = ColorTimeline;
 	var TwoColorTimeline = (function (_super) {
 	var TwoColorTimeline = (function (_super) {
 		__extends(TwoColorTimeline, _super);
 		__extends(TwoColorTimeline, _super);
 		function TwoColorTimeline(frameCount) {
 		function TwoColorTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);
 		}
 		}
 		TwoColorTimeline.prototype.getPropertyId = function () {
 		TwoColorTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.twoColor << 24) + this.slotIndex;
 			return (TimelineType.twoColor << 24) + this.slotIndex;
@@ -523,24 +514,24 @@ var spine;
 				dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);
 				dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);
 			}
 			}
 		};
 		};
+		TwoColorTimeline.ENTRIES = 8;
+		TwoColorTimeline.PREV_TIME = -8;
+		TwoColorTimeline.PREV_R = -7;
+		TwoColorTimeline.PREV_G = -6;
+		TwoColorTimeline.PREV_B = -5;
+		TwoColorTimeline.PREV_A = -4;
+		TwoColorTimeline.PREV_R2 = -3;
+		TwoColorTimeline.PREV_G2 = -2;
+		TwoColorTimeline.PREV_B2 = -1;
+		TwoColorTimeline.R = 1;
+		TwoColorTimeline.G = 2;
+		TwoColorTimeline.B = 3;
+		TwoColorTimeline.A = 4;
+		TwoColorTimeline.R2 = 5;
+		TwoColorTimeline.G2 = 6;
+		TwoColorTimeline.B2 = 7;
 		return TwoColorTimeline;
 		return TwoColorTimeline;
 	}(CurveTimeline));
 	}(CurveTimeline));
-	TwoColorTimeline.ENTRIES = 8;
-	TwoColorTimeline.PREV_TIME = -8;
-	TwoColorTimeline.PREV_R = -7;
-	TwoColorTimeline.PREV_G = -6;
-	TwoColorTimeline.PREV_B = -5;
-	TwoColorTimeline.PREV_A = -4;
-	TwoColorTimeline.PREV_R2 = -3;
-	TwoColorTimeline.PREV_G2 = -2;
-	TwoColorTimeline.PREV_B2 = -1;
-	TwoColorTimeline.R = 1;
-	TwoColorTimeline.G = 2;
-	TwoColorTimeline.B = 3;
-	TwoColorTimeline.A = 4;
-	TwoColorTimeline.R2 = 5;
-	TwoColorTimeline.G2 = 6;
-	TwoColorTimeline.B2 = 7;
 	spine.TwoColorTimeline = TwoColorTimeline;
 	spine.TwoColorTimeline = TwoColorTimeline;
 	var AttachmentTimeline = (function () {
 	var AttachmentTimeline = (function () {
 		function AttachmentTimeline(frameCount) {
 		function AttachmentTimeline(frameCount) {
@@ -587,10 +578,9 @@ var spine;
 	var DeformTimeline = (function (_super) {
 	var DeformTimeline = (function (_super) {
 		__extends(DeformTimeline, _super);
 		__extends(DeformTimeline, _super);
 		function DeformTimeline(frameCount) {
 		function DeformTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount);
-			_this.frameVertices = new Array(frameCount);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount);
+			this.frameVertices = new Array(frameCount);
 		}
 		}
 		DeformTimeline.prototype.getPropertyId = function () {
 		DeformTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.deform << 24) + this.slotIndex;
 			return (TimelineType.deform << 24) + this.slotIndex;
@@ -613,7 +603,7 @@ var spine;
 			}
 			}
 			var frameVertices = this.frameVertices;
 			var frameVertices = this.frameVertices;
 			var vertexCount = frameVertices[0].length;
 			var vertexCount = frameVertices[0].length;
-			if (verticesArray.length != vertexCount)
+			if (verticesArray.length != vertexCount && !setupPose)
 				alpha = 1;
 				alpha = 1;
 			var vertices = spine.Utils.setArraySize(verticesArray, vertexCount);
 			var vertices = spine.Utils.setArraySize(verticesArray, vertexCount);
 			if (time >= frames[frames.length - 1]) {
 			if (time >= frames[frames.length - 1]) {
@@ -771,9 +761,8 @@ var spine;
 	var IkConstraintTimeline = (function (_super) {
 	var IkConstraintTimeline = (function (_super) {
 		__extends(IkConstraintTimeline, _super);
 		__extends(IkConstraintTimeline, _super);
 		function IkConstraintTimeline(frameCount) {
 		function IkConstraintTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);
 		}
 		}
 		IkConstraintTimeline.prototype.getPropertyId = function () {
 		IkConstraintTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;
 			return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;
@@ -821,21 +810,20 @@ var spine;
 					constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
 					constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
 			}
 			}
 		};
 		};
+		IkConstraintTimeline.ENTRIES = 3;
+		IkConstraintTimeline.PREV_TIME = -3;
+		IkConstraintTimeline.PREV_MIX = -2;
+		IkConstraintTimeline.PREV_BEND_DIRECTION = -1;
+		IkConstraintTimeline.MIX = 1;
+		IkConstraintTimeline.BEND_DIRECTION = 2;
 		return IkConstraintTimeline;
 		return IkConstraintTimeline;
 	}(CurveTimeline));
 	}(CurveTimeline));
-	IkConstraintTimeline.ENTRIES = 3;
-	IkConstraintTimeline.PREV_TIME = -3;
-	IkConstraintTimeline.PREV_MIX = -2;
-	IkConstraintTimeline.PREV_BEND_DIRECTION = -1;
-	IkConstraintTimeline.MIX = 1;
-	IkConstraintTimeline.BEND_DIRECTION = 2;
 	spine.IkConstraintTimeline = IkConstraintTimeline;
 	spine.IkConstraintTimeline = IkConstraintTimeline;
 	var TransformConstraintTimeline = (function (_super) {
 	var TransformConstraintTimeline = (function (_super) {
 		__extends(TransformConstraintTimeline, _super);
 		__extends(TransformConstraintTimeline, _super);
 		function TransformConstraintTimeline(frameCount) {
 		function TransformConstraintTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);
 		}
 		}
 		TransformConstraintTimeline.prototype.getPropertyId = function () {
 		TransformConstraintTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;
 			return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;
@@ -896,25 +884,24 @@ var spine;
 				constraint.shearMix += (shear - constraint.shearMix) * alpha;
 				constraint.shearMix += (shear - constraint.shearMix) * alpha;
 			}
 			}
 		};
 		};
+		TransformConstraintTimeline.ENTRIES = 5;
+		TransformConstraintTimeline.PREV_TIME = -5;
+		TransformConstraintTimeline.PREV_ROTATE = -4;
+		TransformConstraintTimeline.PREV_TRANSLATE = -3;
+		TransformConstraintTimeline.PREV_SCALE = -2;
+		TransformConstraintTimeline.PREV_SHEAR = -1;
+		TransformConstraintTimeline.ROTATE = 1;
+		TransformConstraintTimeline.TRANSLATE = 2;
+		TransformConstraintTimeline.SCALE = 3;
+		TransformConstraintTimeline.SHEAR = 4;
 		return TransformConstraintTimeline;
 		return TransformConstraintTimeline;
 	}(CurveTimeline));
 	}(CurveTimeline));
-	TransformConstraintTimeline.ENTRIES = 5;
-	TransformConstraintTimeline.PREV_TIME = -5;
-	TransformConstraintTimeline.PREV_ROTATE = -4;
-	TransformConstraintTimeline.PREV_TRANSLATE = -3;
-	TransformConstraintTimeline.PREV_SCALE = -2;
-	TransformConstraintTimeline.PREV_SHEAR = -1;
-	TransformConstraintTimeline.ROTATE = 1;
-	TransformConstraintTimeline.TRANSLATE = 2;
-	TransformConstraintTimeline.SCALE = 3;
-	TransformConstraintTimeline.SHEAR = 4;
 	spine.TransformConstraintTimeline = TransformConstraintTimeline;
 	spine.TransformConstraintTimeline = TransformConstraintTimeline;
 	var PathConstraintPositionTimeline = (function (_super) {
 	var PathConstraintPositionTimeline = (function (_super) {
 		__extends(PathConstraintPositionTimeline, _super);
 		__extends(PathConstraintPositionTimeline, _super);
 		function PathConstraintPositionTimeline(frameCount) {
 		function PathConstraintPositionTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);
 		}
 		}
 		PathConstraintPositionTimeline.prototype.getPropertyId = function () {
 		PathConstraintPositionTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;
 			return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;
@@ -947,17 +934,17 @@ var spine;
 			else
 			else
 				constraint.position += (position - constraint.position) * alpha;
 				constraint.position += (position - constraint.position) * alpha;
 		};
 		};
+		PathConstraintPositionTimeline.ENTRIES = 2;
+		PathConstraintPositionTimeline.PREV_TIME = -2;
+		PathConstraintPositionTimeline.PREV_VALUE = -1;
+		PathConstraintPositionTimeline.VALUE = 1;
 		return PathConstraintPositionTimeline;
 		return PathConstraintPositionTimeline;
 	}(CurveTimeline));
 	}(CurveTimeline));
-	PathConstraintPositionTimeline.ENTRIES = 2;
-	PathConstraintPositionTimeline.PREV_TIME = -2;
-	PathConstraintPositionTimeline.PREV_VALUE = -1;
-	PathConstraintPositionTimeline.VALUE = 1;
 	spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline;
 	spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline;
 	var PathConstraintSpacingTimeline = (function (_super) {
 	var PathConstraintSpacingTimeline = (function (_super) {
 		__extends(PathConstraintSpacingTimeline, _super);
 		__extends(PathConstraintSpacingTimeline, _super);
 		function PathConstraintSpacingTimeline(frameCount) {
 		function PathConstraintSpacingTimeline(frameCount) {
-			return _super.call(this, frameCount) || this;
+			_super.call(this, frameCount);
 		}
 		}
 		PathConstraintSpacingTimeline.prototype.getPropertyId = function () {
 		PathConstraintSpacingTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;
 			return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;
@@ -991,9 +978,8 @@ var spine;
 	var PathConstraintMixTimeline = (function (_super) {
 	var PathConstraintMixTimeline = (function (_super) {
 		__extends(PathConstraintMixTimeline, _super);
 		__extends(PathConstraintMixTimeline, _super);
 		function PathConstraintMixTimeline(frameCount) {
 		function PathConstraintMixTimeline(frameCount) {
-			var _this = _super.call(this, frameCount) || this;
-			_this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);
-			return _this;
+			_super.call(this, frameCount);
+			this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);
 		}
 		}
 		PathConstraintMixTimeline.prototype.getPropertyId = function () {
 		PathConstraintMixTimeline.prototype.getPropertyId = function () {
 			return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;
 			return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;
@@ -1037,14 +1023,14 @@ var spine;
 				constraint.translateMix += (translate - constraint.translateMix) * alpha;
 				constraint.translateMix += (translate - constraint.translateMix) * alpha;
 			}
 			}
 		};
 		};
+		PathConstraintMixTimeline.ENTRIES = 3;
+		PathConstraintMixTimeline.PREV_TIME = -3;
+		PathConstraintMixTimeline.PREV_ROTATE = -2;
+		PathConstraintMixTimeline.PREV_TRANSLATE = -1;
+		PathConstraintMixTimeline.ROTATE = 1;
+		PathConstraintMixTimeline.TRANSLATE = 2;
 		return PathConstraintMixTimeline;
 		return PathConstraintMixTimeline;
 	}(CurveTimeline));
 	}(CurveTimeline));
-	PathConstraintMixTimeline.ENTRIES = 3;
-	PathConstraintMixTimeline.PREV_TIME = -3;
-	PathConstraintMixTimeline.PREV_ROTATE = -2;
-	PathConstraintMixTimeline.PREV_TRANSLATE = -1;
-	PathConstraintMixTimeline.ROTATE = 1;
-	PathConstraintMixTimeline.TRANSLATE = 2;
 	spine.PathConstraintMixTimeline = PathConstraintMixTimeline;
 	spine.PathConstraintMixTimeline = PathConstraintMixTimeline;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
@@ -1138,10 +1124,12 @@ var spine;
 				this._animationsChanged();
 				this._animationsChanged();
 			var events = this.events;
 			var events = this.events;
 			var tracks = this.tracks;
 			var tracks = this.tracks;
+			var applied = false;
 			for (var i = 0, n = tracks.length; i < n; i++) {
 			for (var i = 0, n = tracks.length; i < n; i++) {
 				var current = tracks[i];
 				var current = tracks[i];
 				if (current == null || current.delay > 0)
 				if (current == null || current.delay > 0)
 					continue;
 					continue;
+				applied = true;
 				var mix = current.alpha;
 				var mix = current.alpha;
 				if (current.mixingFrom != null)
 				if (current.mixingFrom != null)
 					mix *= this.applyMixingFrom(current, skeleton);
 					mix *= this.applyMixingFrom(current, skeleton);
@@ -1175,6 +1163,7 @@ var spine;
 				current.nextTrackLast = current.trackTime;
 				current.nextTrackLast = current.trackTime;
 			}
 			}
 			this.queue.drain();
 			this.queue.drain();
+			return applied;
 		};
 		};
 		AnimationState.prototype.applyMixingFrom = function (to, skeleton) {
 		AnimationState.prototype.applyMixingFrom = function (to, skeleton) {
 			var from = to.mixingFrom;
 			var from = to.mixingFrom;
@@ -1200,7 +1189,7 @@ var spine;
 				spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);
 				spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);
 			var timelinesRotation = from.timelinesRotation;
 			var timelinesRotation = from.timelinesRotation;
 			var first = false;
 			var first = false;
-			var alphaDip = from.alpha * to.interruptAlpha, alphaMix = alphaDip * (1 - mix), alpha;
+			var alphaDip = from.alpha * to.interruptAlpha, alphaMix = alphaDip * (1 - mix), alpha = 0;
 			from.totalAlpha = 0;
 			from.totalAlpha = 0;
 			for (var i = 0; i < timelineCount; i++) {
 			for (var i = 0; i < timelineCount; i++) {
 				var timeline = timelines[i];
 				var timeline = timelines[i];
@@ -1530,13 +1519,13 @@ var spine;
 		AnimationState.prototype.clearListenerNotifications = function () {
 		AnimationState.prototype.clearListenerNotifications = function () {
 			this.queue.clear();
 			this.queue.clear();
 		};
 		};
+		AnimationState.emptyAnimation = new spine.Animation("<empty>", [], 0);
+		AnimationState.SUBSEQUENT = 0;
+		AnimationState.FIRST = 1;
+		AnimationState.DIP = 2;
+		AnimationState.DIP_MIX = 3;
 		return AnimationState;
 		return AnimationState;
 	}());
 	}());
-	AnimationState.emptyAnimation = new spine.Animation("<empty>", [], 0);
-	AnimationState.SUBSEQUENT = 0;
-	AnimationState.FIRST = 1;
-	AnimationState.DIP = 2;
-	AnimationState.DIP_MIX = 3;
 	spine.AnimationState = AnimationState;
 	spine.AnimationState = AnimationState;
 	var TrackEntry = (function () {
 	var TrackEntry = (function () {
 		function TrackEntry() {
 		function TrackEntry() {
@@ -1714,7 +1703,6 @@ var spine;
 		return EventQueue;
 		return EventQueue;
 	}());
 	}());
 	spine.EventQueue = EventQueue;
 	spine.EventQueue = EventQueue;
-	var EventType;
 	(function (EventType) {
 	(function (EventType) {
 		EventType[EventType["start"] = 0] = "start";
 		EventType[EventType["start"] = 0] = "start";
 		EventType[EventType["interrupt"] = 1] = "interrupt";
 		EventType[EventType["interrupt"] = 1] = "interrupt";
@@ -1722,7 +1710,8 @@ var spine;
 		EventType[EventType["dispose"] = 3] = "dispose";
 		EventType[EventType["dispose"] = 3] = "dispose";
 		EventType[EventType["complete"] = 4] = "complete";
 		EventType[EventType["complete"] = 4] = "complete";
 		EventType[EventType["event"] = 5] = "event";
 		EventType[EventType["event"] = 5] = "event";
-	})(EventType = spine.EventType || (spine.EventType = {}));
+	})(spine.EventType || (spine.EventType = {}));
+	var EventType = spine.EventType;
 	var AnimationStateAdapter2 = (function () {
 	var AnimationStateAdapter2 = (function () {
 		function AnimationStateAdapter2() {
 		function AnimationStateAdapter2() {
 		}
 		}
@@ -1948,4286 +1937,4282 @@ var spine;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var BlendMode;
-	(function (BlendMode) {
-		BlendMode[BlendMode["Normal"] = 0] = "Normal";
-		BlendMode[BlendMode["Additive"] = 1] = "Additive";
-		BlendMode[BlendMode["Multiply"] = 2] = "Multiply";
-		BlendMode[BlendMode["Screen"] = 3] = "Screen";
-	})(BlendMode = spine.BlendMode || (spine.BlendMode = {}));
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var Bone = (function () {
-		function Bone(data, skeleton, parent) {
-			this.children = new Array();
-			this.x = 0;
-			this.y = 0;
-			this.rotation = 0;
-			this.scaleX = 0;
-			this.scaleY = 0;
-			this.shearX = 0;
-			this.shearY = 0;
-			this.ax = 0;
-			this.ay = 0;
-			this.arotation = 0;
-			this.ascaleX = 0;
-			this.ascaleY = 0;
-			this.ashearX = 0;
-			this.ashearY = 0;
-			this.appliedValid = false;
-			this.a = 0;
-			this.b = 0;
-			this.worldX = 0;
-			this.c = 0;
-			this.d = 0;
-			this.worldY = 0;
-			this.sorted = false;
-			if (data == null)
-				throw new Error("data cannot be null.");
-			if (skeleton == null)
-				throw new Error("skeleton cannot be null.");
-			this.data = data;
-			this.skeleton = skeleton;
-			this.parent = parent;
-			this.setToSetupPose();
+	var Attachment = (function () {
+		function Attachment(name) {
+			if (name == null)
+				throw new Error("name cannot be null.");
+			this.name = name;
 		}
 		}
-		Bone.prototype.update = function () {
-			this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);
-		};
-		Bone.prototype.updateWorldTransform = function () {
-			this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);
-		};
-		Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {
-			this.ax = x;
-			this.ay = y;
-			this.arotation = rotation;
-			this.ascaleX = scaleX;
-			this.ascaleY = scaleY;
-			this.ashearX = shearX;
-			this.ashearY = shearY;
-			this.appliedValid = true;
-			var parent = this.parent;
-			if (parent == null) {
-				var rotationY = rotation + 90 + shearY;
-				var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-				var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
-				var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-				var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
-				var skeleton = this.skeleton;
-				if (skeleton.flipX) {
-					x = -x;
-					la = -la;
-					lb = -lb;
-				}
-				if (skeleton.flipY) {
-					y = -y;
-					lc = -lc;
-					ld = -ld;
+		return Attachment;
+	}());
+	spine.Attachment = Attachment;
+	var VertexAttachment = (function (_super) {
+		__extends(VertexAttachment, _super);
+		function VertexAttachment(name) {
+			_super.call(this, name);
+			this.worldVerticesLength = 0;
+		}
+		VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {
+			count = offset + (count >> 1) * stride;
+			var skeleton = slot.bone.skeleton;
+			var deformArray = slot.attachmentVertices;
+			var vertices = this.vertices;
+			var bones = this.bones;
+			if (bones == null) {
+				if (deformArray.length > 0)
+					vertices = deformArray;
+				var bone = slot.bone;
+				var x = bone.worldX;
+				var y = bone.worldY;
+				var a = bone.a, b = bone.b, c = bone.c, d = bone.d;
+				for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {
+					var vx = vertices[v_1], vy = vertices[v_1 + 1];
+					worldVertices[w] = vx * a + vy * b + x;
+					worldVertices[w + 1] = vx * c + vy * d + y;
 				}
 				}
-				this.a = la;
-				this.b = lb;
-				this.c = lc;
-				this.d = ld;
-				this.worldX = x + skeleton.x;
-				this.worldY = y + skeleton.y;
 				return;
 				return;
 			}
 			}
-			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
-			this.worldX = pa * x + pb * y + parent.worldX;
-			this.worldY = pc * x + pd * y + parent.worldY;
-			switch (this.data.transformMode) {
-				case spine.TransformMode.Normal: {
-					var rotationY = rotation + 90 + shearY;
-					var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-					var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
-					var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-					var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
-					this.a = pa * la + pb * lc;
-					this.b = pa * lb + pb * ld;
-					this.c = pc * la + pd * lc;
-					this.d = pc * lb + pd * ld;
-					return;
-				}
-				case spine.TransformMode.OnlyTranslation: {
-					var rotationY = rotation + 90 + shearY;
-					this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
-					this.b = spine.MathUtils.cosDeg(rotationY) * scaleY;
-					this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
-					this.d = spine.MathUtils.sinDeg(rotationY) * scaleY;
-					break;
-				}
-				case spine.TransformMode.NoRotationOrReflection: {
-					var s = pa * pa + pc * pc;
-					var prx = 0;
-					if (s > 0.0001) {
-						s = Math.abs(pa * pd - pb * pc) / s;
-						pb = pc * s;
-						pd = pa * s;
-						prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg;
-					}
-					else {
-						pa = 0;
-						pc = 0;
-						prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg;
+			var v = 0, skip = 0;
+			for (var i = 0; i < start; i += 2) {
+				var n = bones[v];
+				v += n + 1;
+				skip += n;
+			}
+			var skeletonBones = skeleton.bones;
+			if (deformArray.length == 0) {
+				for (var w = offset, b = skip * 3; w < count; w += stride) {
+					var wx = 0, wy = 0;
+					var n = bones[v++];
+					n += v;
+					for (; v < n; v++, b += 3) {
+						var bone = skeletonBones[bones[v]];
+						var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];
+						wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;
+						wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;
 					}
 					}
-					var rx = rotation + shearX - prx;
-					var ry = rotation + shearY - prx + 90;
-					var la = spine.MathUtils.cosDeg(rx) * scaleX;
-					var lb = spine.MathUtils.cosDeg(ry) * scaleY;
-					var lc = spine.MathUtils.sinDeg(rx) * scaleX;
-					var ld = spine.MathUtils.sinDeg(ry) * scaleY;
-					this.a = pa * la - pb * lc;
-					this.b = pa * lb - pb * ld;
-					this.c = pc * la + pd * lc;
-					this.d = pc * lb + pd * ld;
-					break;
+					worldVertices[w] = wx;
+					worldVertices[w + 1] = wy;
 				}
 				}
-				case spine.TransformMode.NoScale:
-				case spine.TransformMode.NoScaleOrReflection: {
-					var cos = spine.MathUtils.cosDeg(rotation);
-					var sin = spine.MathUtils.sinDeg(rotation);
-					var za = pa * cos + pb * sin;
-					var zc = pc * cos + pd * sin;
-					var s = Math.sqrt(za * za + zc * zc);
-					if (s > 0.00001)
-						s = 1 / s;
-					za *= s;
-					zc *= s;
-					s = Math.sqrt(za * za + zc * zc);
-					var r = Math.PI / 2 + Math.atan2(zc, za);
-					var zb = Math.cos(r) * s;
-					var zd = Math.sin(r) * s;
-					var la = spine.MathUtils.cosDeg(shearX) * scaleX;
-					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
-					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
-					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
-					this.a = za * la + zb * lc;
-					this.b = za * lb + zb * ld;
-					this.c = zc * la + zd * lc;
-					this.d = zc * lb + zd * ld;
-					if (this.data.transformMode != spine.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
-						this.b = -this.b;
-						this.d = -this.d;
+			}
+			else {
+				var deform = deformArray;
+				for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {
+					var wx = 0, wy = 0;
+					var n = bones[v++];
+					n += v;
+					for (; v < n; v++, b += 3, f += 2) {
+						var bone = skeletonBones[bones[v]];
+						var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];
+						wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;
+						wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;
 					}
 					}
-					return;
+					worldVertices[w] = wx;
+					worldVertices[w + 1] = wy;
 				}
 				}
 			}
 			}
-			if (this.skeleton.flipX) {
-				this.a = -this.a;
-				this.b = -this.b;
-			}
-			if (this.skeleton.flipY) {
-				this.c = -this.c;
-				this.d = -this.d;
-			}
-		};
-		Bone.prototype.setToSetupPose = function () {
-			var data = this.data;
-			this.x = data.x;
-			this.y = data.y;
-			this.rotation = data.rotation;
-			this.scaleX = data.scaleX;
-			this.scaleY = data.scaleY;
-			this.shearX = data.shearX;
-			this.shearY = data.shearY;
-		};
-		Bone.prototype.getWorldRotationX = function () {
-			return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;
-		};
-		Bone.prototype.getWorldRotationY = function () {
-			return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg;
-		};
-		Bone.prototype.getWorldScaleX = function () {
-			return Math.sqrt(this.a * this.a + this.c * this.c);
 		};
 		};
-		Bone.prototype.getWorldScaleY = function () {
-			return Math.sqrt(this.b * this.b + this.d * this.d);
+		VertexAttachment.prototype.applyDeform = function (sourceAttachment) {
+			return this == sourceAttachment;
 		};
 		};
-		Bone.prototype.updateAppliedTransform = function () {
-			this.appliedValid = true;
-			var parent = this.parent;
-			if (parent == null) {
-				this.ax = this.worldX;
-				this.ay = this.worldY;
-				this.arotation = Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;
-				this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);
-				this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);
-				this.ashearX = 0;
-				this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg;
-				return;
-			}
-			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
-			var pid = 1 / (pa * pd - pb * pc);
-			var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;
-			this.ax = (dx * pd * pid - dy * pb * pid);
-			this.ay = (dy * pa * pid - dx * pc * pid);
-			var ia = pid * pd;
-			var id = pid * pa;
-			var ib = pid * pb;
-			var ic = pid * pc;
-			var ra = ia * this.a - ib * this.c;
-			var rb = ia * this.b - ib * this.d;
-			var rc = id * this.c - ic * this.a;
-			var rd = id * this.d - ic * this.b;
-			this.ashearX = 0;
-			this.ascaleX = Math.sqrt(ra * ra + rc * rc);
-			if (this.ascaleX > 0.0001) {
-				var det = ra * rd - rb * rc;
-				this.ascaleY = det / this.ascaleX;
-				this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg;
-				this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg;
-			}
-			else {
-				this.ascaleX = 0;
-				this.ascaleY = Math.sqrt(rb * rb + rd * rd);
-				this.ashearY = 0;
-				this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg;
-			}
-		};
-		Bone.prototype.worldToLocal = function (world) {
-			var a = this.a, b = this.b, c = this.c, d = this.d;
-			var invDet = 1 / (a * d - b * c);
-			var x = world.x - this.worldX, y = world.y - this.worldY;
-			world.x = (x * d * invDet - y * b * invDet);
-			world.y = (y * a * invDet - x * c * invDet);
-			return world;
-		};
-		Bone.prototype.localToWorld = function (local) {
-			var x = local.x, y = local.y;
-			local.x = x * this.a + y * this.b + this.worldX;
-			local.y = x * this.c + y * this.d + this.worldY;
-			return local;
-		};
-		Bone.prototype.worldToLocalRotation = function (worldRotation) {
-			var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation);
-			return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg;
-		};
-		Bone.prototype.localToWorldRotation = function (localRotation) {
-			var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation);
-			return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg;
-		};
-		Bone.prototype.rotateWorld = function (degrees) {
-			var a = this.a, b = this.b, c = this.c, d = this.d;
-			var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees);
-			this.a = cos * a - sin * c;
-			this.b = cos * b - sin * d;
-			this.c = sin * a + cos * c;
-			this.d = sin * b + cos * d;
-			this.appliedValid = false;
-		};
-		return Bone;
-	}());
-	spine.Bone = Bone;
+		return VertexAttachment;
+	}(Attachment));
+	spine.VertexAttachment = VertexAttachment;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var BoneData = (function () {
-		function BoneData(index, name, parent) {
-			this.x = 0;
-			this.y = 0;
-			this.rotation = 0;
-			this.scaleX = 1;
-			this.scaleY = 1;
-			this.shearX = 0;
-			this.shearY = 0;
-			this.transformMode = TransformMode.Normal;
-			if (index < 0)
-				throw new Error("index must be >= 0.");
-			if (name == null)
-				throw new Error("name cannot be null.");
-			this.index = index;
-			this.name = name;
-			this.parent = parent;
-		}
-		return BoneData;
-	}());
-	spine.BoneData = BoneData;
-	var TransformMode;
-	(function (TransformMode) {
-		TransformMode[TransformMode["Normal"] = 0] = "Normal";
-		TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation";
-		TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection";
-		TransformMode[TransformMode["NoScale"] = 3] = "NoScale";
-		TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection";
-	})(TransformMode = spine.TransformMode || (spine.TransformMode = {}));
+	(function (AttachmentType) {
+		AttachmentType[AttachmentType["Region"] = 0] = "Region";
+		AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox";
+		AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh";
+		AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh";
+		AttachmentType[AttachmentType["Path"] = 4] = "Path";
+		AttachmentType[AttachmentType["Point"] = 5] = "Point";
+	})(spine.AttachmentType || (spine.AttachmentType = {}));
+	var AttachmentType = spine.AttachmentType;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var Event = (function () {
-		function Event(time, data) {
-			if (data == null)
-				throw new Error("data cannot be null.");
-			this.time = time;
-			this.data = data;
+	var BoundingBoxAttachment = (function (_super) {
+		__extends(BoundingBoxAttachment, _super);
+		function BoundingBoxAttachment(name) {
+			_super.call(this, name);
+			this.color = new spine.Color(1, 1, 1, 1);
 		}
 		}
-		return Event;
-	}());
-	spine.Event = Event;
+		return BoundingBoxAttachment;
+	}(spine.VertexAttachment));
+	spine.BoundingBoxAttachment = BoundingBoxAttachment;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var EventData = (function () {
-		function EventData(name) {
-			this.name = name;
+	var ClippingAttachment = (function (_super) {
+		__extends(ClippingAttachment, _super);
+		function ClippingAttachment(name) {
+			_super.call(this, name);
+			this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1);
 		}
 		}
-		return EventData;
-	}());
-	spine.EventData = EventData;
+		return ClippingAttachment;
+	}(spine.VertexAttachment));
+	spine.ClippingAttachment = ClippingAttachment;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var IkConstraint = (function () {
-		function IkConstraint(data, skeleton) {
-			this.mix = 1;
-			this.bendDirection = 0;
-			if (data == null)
-				throw new Error("data cannot be null.");
-			if (skeleton == null)
-				throw new Error("skeleton cannot be null.");
-			this.data = data;
-			this.mix = data.mix;
-			this.bendDirection = data.bendDirection;
-			this.bones = new Array();
-			for (var i = 0; i < data.bones.length; i++)
-				this.bones.push(skeleton.findBone(data.bones[i].name));
-			this.target = skeleton.findBone(data.target.name);
+	var MeshAttachment = (function (_super) {
+		__extends(MeshAttachment, _super);
+		function MeshAttachment(name) {
+			_super.call(this, name);
+			this.color = new spine.Color(1, 1, 1, 1);
+			this.inheritDeform = false;
+			this.tempColor = new spine.Color(0, 0, 0, 0);
 		}
 		}
-		IkConstraint.prototype.getOrder = function () {
-			return this.data.order;
-		};
-		IkConstraint.prototype.apply = function () {
-			this.update();
-		};
-		IkConstraint.prototype.update = function () {
-			var target = this.target;
-			var bones = this.bones;
-			switch (bones.length) {
-				case 1:
-					this.apply1(bones[0], target.worldX, target.worldY, this.mix);
-					break;
-				case 2:
-					this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix);
-					break;
-			}
-		};
-		IkConstraint.prototype.apply1 = function (bone, targetX, targetY, alpha) {
-			if (!bone.appliedValid)
-				bone.updateAppliedTransform();
-			var p = bone.parent;
-			var id = 1 / (p.a * p.d - p.b * p.c);
-			var x = targetX - p.worldX, y = targetY - p.worldY;
-			var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay;
-			var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation;
-			if (bone.ascaleX < 0)
-				rotationIK += 180;
-			if (rotationIK > 180)
-				rotationIK -= 360;
-			else if (rotationIK < -180)
-				rotationIK += 360;
-			bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, bone.ascaleX, bone.ascaleY, bone.ashearX, bone.ashearY);
-		};
-		IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, alpha) {
-			if (alpha == 0) {
-				child.updateWorldTransform();
-				return;
-			}
-			if (!parent.appliedValid)
-				parent.updateAppliedTransform();
-			if (!child.appliedValid)
-				child.updateAppliedTransform();
-			var px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, csx = child.ascaleX;
-			var os1 = 0, os2 = 0, s2 = 0;
-			if (psx < 0) {
-				psx = -psx;
-				os1 = 180;
-				s2 = -1;
+		MeshAttachment.prototype.updateUVs = function () {
+			var u = 0, v = 0, width = 0, height = 0;
+			if (this.region == null) {
+				u = v = 0;
+				width = height = 1;
 			}
 			}
 			else {
 			else {
-				os1 = 0;
-				s2 = 1;
-			}
-			if (psy < 0) {
-				psy = -psy;
-				s2 = -s2;
-			}
-			if (csx < 0) {
-				csx = -csx;
-				os2 = 180;
+				u = this.region.u;
+				v = this.region.v;
+				width = this.region.u2 - u;
+				height = this.region.v2 - v;
 			}
 			}
-			else
-				os2 = 0;
-			var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;
-			var u = Math.abs(psx - psy) <= 0.0001;
-			if (!u) {
-				cy = 0;
-				cwx = a * cx + parent.worldX;
-				cwy = c * cx + parent.worldY;
+			var regionUVs = this.regionUVs;
+			if (this.uvs == null || this.uvs.length != regionUVs.length)
+				this.uvs = spine.Utils.newFloatArray(regionUVs.length);
+			var uvs = this.uvs;
+			if (this.region.rotate) {
+				for (var i = 0, n = uvs.length; i < n; i += 2) {
+					uvs[i] = u + regionUVs[i + 1] * width;
+					uvs[i + 1] = v + height - regionUVs[i] * height;
+				}
 			}
 			}
 			else {
 			else {
-				cy = child.ay;
-				cwx = a * cx + b * cy + parent.worldX;
-				cwy = c * cx + d * cy + parent.worldY;
+				for (var i = 0, n = uvs.length; i < n; i += 2) {
+					uvs[i] = u + regionUVs[i] * width;
+					uvs[i + 1] = v + regionUVs[i + 1] * height;
+				}
 			}
 			}
-			var pp = parent.parent;
-			a = pp.a;
-			b = pp.b;
-			c = pp.c;
-			d = pp.d;
-			var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY;
-			var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;
-			x = cwx - pp.worldX;
-			y = cwy - pp.worldY;
-			var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;
-			var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;
-			outer: if (u) {
-				l2 *= psx;
-				var cos = (tx * tx + ty * ty - l1 * l1 - l2 * l2) / (2 * l1 * l2);
-				if (cos < -1)
-					cos = -1;
-				else if (cos > 1)
-					cos = 1;
-				a2 = Math.acos(cos) * bendDir;
-				a = l1 + l2 * cos;
-				b = l2 * Math.sin(a2);
-				a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);
+		};
+		MeshAttachment.prototype.applyDeform = function (sourceAttachment) {
+			return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);
+		};
+		MeshAttachment.prototype.getParentMesh = function () {
+			return this.parentMesh;
+		};
+		MeshAttachment.prototype.setParentMesh = function (parentMesh) {
+			this.parentMesh = parentMesh;
+			if (parentMesh != null) {
+				this.bones = parentMesh.bones;
+				this.vertices = parentMesh.vertices;
+				this.worldVerticesLength = parentMesh.worldVerticesLength;
+				this.regionUVs = parentMesh.regionUVs;
+				this.triangles = parentMesh.triangles;
+				this.hullLength = parentMesh.hullLength;
+				this.worldVerticesLength = parentMesh.worldVerticesLength;
+			}
+		};
+		return MeshAttachment;
+	}(spine.VertexAttachment));
+	spine.MeshAttachment = MeshAttachment;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var PathAttachment = (function (_super) {
+		__extends(PathAttachment, _super);
+		function PathAttachment(name) {
+			_super.call(this, name);
+			this.closed = false;
+			this.constantSpeed = false;
+			this.color = new spine.Color(1, 1, 1, 1);
+		}
+		return PathAttachment;
+	}(spine.VertexAttachment));
+	spine.PathAttachment = PathAttachment;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var PointAttachment = (function (_super) {
+		__extends(PointAttachment, _super);
+		function PointAttachment(name) {
+			_super.call(this, name);
+			this.color = new spine.Color(0.38, 0.94, 0, 1);
+		}
+		PointAttachment.prototype.computeWorldPosition = function (bone, point) {
+			point.x = this.x * bone.a + this.y * bone.b + bone.worldX;
+			point.y = this.x * bone.c + this.y * bone.d + bone.worldY;
+			return point;
+		};
+		PointAttachment.prototype.computeWorldRotation = function (bone) {
+			var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation);
+			var x = cos * bone.a + sin * bone.b;
+			var y = cos * bone.c + sin * bone.d;
+			return Math.atan2(y, x) * spine.MathUtils.radDeg;
+		};
+		return PointAttachment;
+	}(spine.VertexAttachment));
+	spine.PointAttachment = PointAttachment;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var RegionAttachment = (function (_super) {
+		__extends(RegionAttachment, _super);
+		function RegionAttachment(name) {
+			_super.call(this, name);
+			this.x = 0;
+			this.y = 0;
+			this.scaleX = 1;
+			this.scaleY = 1;
+			this.rotation = 0;
+			this.width = 0;
+			this.height = 0;
+			this.color = new spine.Color(1, 1, 1, 1);
+			this.offset = spine.Utils.newFloatArray(8);
+			this.uvs = spine.Utils.newFloatArray(8);
+			this.tempColor = new spine.Color(1, 1, 1, 1);
+		}
+		RegionAttachment.prototype.updateOffset = function () {
+			var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
+			var regionScaleY = this.height / this.region.originalHeight * this.scaleY;
+			var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;
+			var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;
+			var localX2 = localX + this.region.width * regionScaleX;
+			var localY2 = localY + this.region.height * regionScaleY;
+			var radians = this.rotation * Math.PI / 180;
+			var cos = Math.cos(radians);
+			var sin = Math.sin(radians);
+			var localXCos = localX * cos + this.x;
+			var localXSin = localX * sin;
+			var localYCos = localY * cos + this.y;
+			var localYSin = localY * sin;
+			var localX2Cos = localX2 * cos + this.x;
+			var localX2Sin = localX2 * sin;
+			var localY2Cos = localY2 * cos + this.y;
+			var localY2Sin = localY2 * sin;
+			var offset = this.offset;
+			offset[RegionAttachment.OX1] = localXCos - localYSin;
+			offset[RegionAttachment.OY1] = localYCos + localXSin;
+			offset[RegionAttachment.OX2] = localXCos - localY2Sin;
+			offset[RegionAttachment.OY2] = localY2Cos + localXSin;
+			offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;
+			offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;
+			offset[RegionAttachment.OX4] = localX2Cos - localYSin;
+			offset[RegionAttachment.OY4] = localYCos + localX2Sin;
+		};
+		RegionAttachment.prototype.setRegion = function (region) {
+			this.region = region;
+			var uvs = this.uvs;
+			if (region.rotate) {
+				uvs[2] = region.u;
+				uvs[3] = region.v2;
+				uvs[4] = region.u;
+				uvs[5] = region.v;
+				uvs[6] = region.u2;
+				uvs[7] = region.v;
+				uvs[0] = region.u2;
+				uvs[1] = region.v2;
 			}
 			}
 			else {
 			else {
-				a = psx * l2;
-				b = psy * l2;
-				var aa = a * a, bb = b * b, dd = tx * tx + ty * ty, ta = Math.atan2(ty, tx);
-				c = bb * l1 * l1 + aa * dd - aa * bb;
-				var c1 = -2 * bb * l1, c2 = bb - aa;
-				d = c1 * c1 - 4 * c2 * c;
-				if (d >= 0) {
-					var q = Math.sqrt(d);
-					if (c1 < 0)
-						q = -q;
-					q = -(c1 + q) / 2;
-					var r0 = q / c2, r1 = c / q;
-					var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;
-					if (r * r <= dd) {
-						y = Math.sqrt(dd - r * r) * bendDir;
-						a1 = ta - Math.atan2(y, r);
-						a2 = Math.atan2(y / psy, (r - l1) / psx);
-						break outer;
-					}
-				}
-				var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;
-				var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;
-				var angle = Math.acos(-a * l1 / (aa - bb));
-				x = a * Math.cos(angle) + l1;
-				y = b * Math.sin(angle);
-				d = x * x + y * y;
-				if (d < minDist) {
-					minAngle = angle;
-					minDist = d;
-					minX = x;
-					minY = y;
-				}
-				if (d > maxDist) {
-					maxAngle = angle;
-					maxDist = d;
-					maxX = x;
-					maxY = y;
-				}
-				if (dd <= (minDist + maxDist) / 2) {
-					a1 = ta - Math.atan2(minY * bendDir, minX);
-					a2 = minAngle * bendDir;
-				}
-				else {
-					a1 = ta - Math.atan2(maxY * bendDir, maxX);
-					a2 = maxAngle * bendDir;
-				}
+				uvs[0] = region.u;
+				uvs[1] = region.v2;
+				uvs[2] = region.u;
+				uvs[3] = region.v;
+				uvs[4] = region.u2;
+				uvs[5] = region.v;
+				uvs[6] = region.u2;
+				uvs[7] = region.v2;
 			}
 			}
-			var os = Math.atan2(cy, cx) * s2;
-			var rotation = parent.arotation;
-			a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation;
-			if (a1 > 180)
-				a1 -= 360;
-			else if (a1 < -180)
-				a1 += 360;
-			parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, parent.ascaleX, parent.ascaleY, 0, 0);
-			rotation = child.arotation;
-			a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;
-			if (a2 > 180)
-				a2 -= 360;
-			else if (a2 < -180)
-				a2 += 360;
-			child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);
 		};
 		};
-		return IkConstraint;
-	}());
-	spine.IkConstraint = IkConstraint;
+		RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {
+			var vertexOffset = this.offset;
+			var x = bone.worldX, y = bone.worldY;
+			var a = bone.a, b = bone.b, c = bone.c, d = bone.d;
+			var offsetX = 0, offsetY = 0;
+			offsetX = vertexOffset[RegionAttachment.OX1];
+			offsetY = vertexOffset[RegionAttachment.OY1];
+			worldVertices[offset] = offsetX * a + offsetY * b + x;
+			worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
+			offset += stride;
+			offsetX = vertexOffset[RegionAttachment.OX2];
+			offsetY = vertexOffset[RegionAttachment.OY2];
+			worldVertices[offset] = offsetX * a + offsetY * b + x;
+			worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
+			offset += stride;
+			offsetX = vertexOffset[RegionAttachment.OX3];
+			offsetY = vertexOffset[RegionAttachment.OY3];
+			worldVertices[offset] = offsetX * a + offsetY * b + x;
+			worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
+			offset += stride;
+			offsetX = vertexOffset[RegionAttachment.OX4];
+			offsetY = vertexOffset[RegionAttachment.OY4];
+			worldVertices[offset] = offsetX * a + offsetY * b + x;
+			worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
+		};
+		RegionAttachment.OX1 = 0;
+		RegionAttachment.OY1 = 1;
+		RegionAttachment.OX2 = 2;
+		RegionAttachment.OY2 = 3;
+		RegionAttachment.OX3 = 4;
+		RegionAttachment.OY3 = 5;
+		RegionAttachment.OX4 = 6;
+		RegionAttachment.OY4 = 7;
+		RegionAttachment.X1 = 0;
+		RegionAttachment.Y1 = 1;
+		RegionAttachment.C1R = 2;
+		RegionAttachment.C1G = 3;
+		RegionAttachment.C1B = 4;
+		RegionAttachment.C1A = 5;
+		RegionAttachment.U1 = 6;
+		RegionAttachment.V1 = 7;
+		RegionAttachment.X2 = 8;
+		RegionAttachment.Y2 = 9;
+		RegionAttachment.C2R = 10;
+		RegionAttachment.C2G = 11;
+		RegionAttachment.C2B = 12;
+		RegionAttachment.C2A = 13;
+		RegionAttachment.U2 = 14;
+		RegionAttachment.V2 = 15;
+		RegionAttachment.X3 = 16;
+		RegionAttachment.Y3 = 17;
+		RegionAttachment.C3R = 18;
+		RegionAttachment.C3G = 19;
+		RegionAttachment.C3B = 20;
+		RegionAttachment.C3A = 21;
+		RegionAttachment.U3 = 22;
+		RegionAttachment.V3 = 23;
+		RegionAttachment.X4 = 24;
+		RegionAttachment.Y4 = 25;
+		RegionAttachment.C4R = 26;
+		RegionAttachment.C4G = 27;
+		RegionAttachment.C4B = 28;
+		RegionAttachment.C4A = 29;
+		RegionAttachment.U4 = 30;
+		RegionAttachment.V4 = 31;
+		return RegionAttachment;
+	}(spine.Attachment));
+	spine.RegionAttachment = RegionAttachment;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var IkConstraintData = (function () {
-		function IkConstraintData(name) {
-			this.order = 0;
-			this.bones = new Array();
-			this.bendDirection = 1;
-			this.mix = 1;
-			this.name = name;
-		}
-		return IkConstraintData;
-	}());
-	spine.IkConstraintData = IkConstraintData;
+	(function (BlendMode) {
+		BlendMode[BlendMode["Normal"] = 0] = "Normal";
+		BlendMode[BlendMode["Additive"] = 1] = "Additive";
+		BlendMode[BlendMode["Multiply"] = 2] = "Multiply";
+		BlendMode[BlendMode["Screen"] = 3] = "Screen";
+	})(spine.BlendMode || (spine.BlendMode = {}));
+	var BlendMode = spine.BlendMode;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var PathConstraint = (function () {
-		function PathConstraint(data, skeleton) {
-			this.position = 0;
-			this.spacing = 0;
-			this.rotateMix = 0;
-			this.translateMix = 0;
-			this.spaces = new Array();
-			this.positions = new Array();
-			this.world = new Array();
-			this.curves = new Array();
-			this.lengths = new Array();
-			this.segments = new Array();
+	var Bone = (function () {
+		function Bone(data, skeleton, parent) {
+			this.children = new Array();
+			this.x = 0;
+			this.y = 0;
+			this.rotation = 0;
+			this.scaleX = 0;
+			this.scaleY = 0;
+			this.shearX = 0;
+			this.shearY = 0;
+			this.ax = 0;
+			this.ay = 0;
+			this.arotation = 0;
+			this.ascaleX = 0;
+			this.ascaleY = 0;
+			this.ashearX = 0;
+			this.ashearY = 0;
+			this.appliedValid = false;
+			this.a = 0;
+			this.b = 0;
+			this.worldX = 0;
+			this.c = 0;
+			this.d = 0;
+			this.worldY = 0;
+			this.sorted = false;
 			if (data == null)
 			if (data == null)
 				throw new Error("data cannot be null.");
 				throw new Error("data cannot be null.");
 			if (skeleton == null)
 			if (skeleton == null)
 				throw new Error("skeleton cannot be null.");
 				throw new Error("skeleton cannot be null.");
 			this.data = data;
 			this.data = data;
-			this.bones = new Array();
-			for (var i = 0, n = data.bones.length; i < n; i++)
-				this.bones.push(skeleton.findBone(data.bones[i].name));
-			this.target = skeleton.findSlot(data.target.name);
-			this.position = data.position;
-			this.spacing = data.spacing;
-			this.rotateMix = data.rotateMix;
-			this.translateMix = data.translateMix;
+			this.skeleton = skeleton;
+			this.parent = parent;
+			this.setToSetupPose();
 		}
 		}
-		PathConstraint.prototype.apply = function () {
-			this.update();
+		Bone.prototype.update = function () {
+			this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);
 		};
 		};
-		PathConstraint.prototype.update = function () {
-			var attachment = this.target.getAttachment();
-			if (!(attachment instanceof spine.PathAttachment))
-				return;
-			var rotateMix = this.rotateMix, translateMix = this.translateMix;
-			var translate = translateMix > 0, rotate = rotateMix > 0;
-			if (!translate && !rotate)
-				return;
-			var data = this.data;
-			var spacingMode = data.spacingMode;
-			var lengthSpacing = spacingMode == spine.SpacingMode.Length;
-			var rotateMode = data.rotateMode;
-			var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale;
-			var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;
-			var bones = this.bones;
-			var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null;
-			var spacing = this.spacing;
-			if (scale || lengthSpacing) {
-				if (scale)
-					lengths = spine.Utils.setArraySize(this.lengths, boneCount);
-				for (var i = 0, n = spacesCount - 1; i < n;) {
-					var bone = bones[i];
-					var setupLength = bone.data.length, x = setupLength * bone.a, y = setupLength * bone.c;
-					var length_1 = Math.sqrt(x * x + y * y);
-					if (scale)
-						lengths[i] = length_1;
-					spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_1 / setupLength;
+		Bone.prototype.updateWorldTransform = function () {
+			this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);
+		};
+		Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {
+			this.ax = x;
+			this.ay = y;
+			this.arotation = rotation;
+			this.ascaleX = scaleX;
+			this.ascaleY = scaleY;
+			this.ashearX = shearX;
+			this.ashearY = shearY;
+			this.appliedValid = true;
+			var parent = this.parent;
+			if (parent == null) {
+				var rotationY = rotation + 90 + shearY;
+				var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
+				var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
+				var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
+				var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
+				var skeleton = this.skeleton;
+				if (skeleton.flipX) {
+					x = -x;
+					la = -la;
+					lb = -lb;
 				}
 				}
+				if (skeleton.flipY) {
+					y = -y;
+					lc = -lc;
+					ld = -ld;
+				}
+				this.a = la;
+				this.b = lb;
+				this.c = lc;
+				this.d = ld;
+				this.worldX = x + skeleton.x;
+				this.worldY = y + skeleton.y;
+				return;
 			}
 			}
-			else {
-				for (var i = 1; i < spacesCount; i++)
-					spaces[i] = spacing;
-			}
-			var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, spacingMode == spine.SpacingMode.Percent);
-			var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;
-			var tip = false;
-			if (offsetRotation == 0)
-				tip = rotateMode == spine.RotateMode.Chain;
-			else {
-				tip = false;
-				var p = this.target.bone;
-				offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;
-			}
-			for (var i = 0, p = 3; i < boneCount; i++, p += 3) {
-				var bone = bones[i];
-				bone.worldX += (boneX - bone.worldX) * translateMix;
-				bone.worldY += (boneY - bone.worldY) * translateMix;
-				var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;
-				if (scale) {
-					var length_2 = lengths[i];
-					if (length_2 != 0) {
-						var s = (Math.sqrt(dx * dx + dy * dy) / length_2 - 1) * rotateMix + 1;
-						bone.a *= s;
-						bone.c *= s;
-					}
+			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
+			this.worldX = pa * x + pb * y + parent.worldX;
+			this.worldY = pc * x + pd * y + parent.worldY;
+			switch (this.data.transformMode) {
+				case spine.TransformMode.Normal: {
+					var rotationY = rotation + 90 + shearY;
+					var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
+					var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;
+					var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
+					var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;
+					this.a = pa * la + pb * lc;
+					this.b = pa * lb + pb * ld;
+					this.c = pc * la + pd * lc;
+					this.d = pc * lb + pd * ld;
+					return;
 				}
 				}
-				boneX = x;
-				boneY = y;
-				if (rotate) {
-					var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;
-					if (tangents)
-						r = positions[p - 1];
-					else if (spaces[i + 1] == 0)
-						r = positions[p + 2];
-					else
-						r = Math.atan2(dy, dx);
-					r -= Math.atan2(c, a);
-					if (tip) {
-						cos = Math.cos(r);
-						sin = Math.sin(r);
-						var length_3 = bone.data.length;
-						boneX += (length_3 * (cos * a - sin * c) - dx) * rotateMix;
-						boneY += (length_3 * (sin * a + cos * c) - dy) * rotateMix;
+				case spine.TransformMode.OnlyTranslation: {
+					var rotationY = rotation + 90 + shearY;
+					this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;
+					this.b = spine.MathUtils.cosDeg(rotationY) * scaleY;
+					this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;
+					this.d = spine.MathUtils.sinDeg(rotationY) * scaleY;
+					break;
+				}
+				case spine.TransformMode.NoRotationOrReflection: {
+					var s = pa * pa + pc * pc;
+					var prx = 0;
+					if (s > 0.0001) {
+						s = Math.abs(pa * pd - pb * pc) / s;
+						pb = pc * s;
+						pd = pa * s;
+						prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg;
 					}
 					}
 					else {
 					else {
-						r += offsetRotation;
+						pa = 0;
+						pc = 0;
+						prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg;
 					}
 					}
-					if (r > spine.MathUtils.PI)
-						r -= spine.MathUtils.PI2;
-					else if (r < -spine.MathUtils.PI)
-						r += spine.MathUtils.PI2;
-					r *= rotateMix;
-					cos = Math.cos(r);
-					sin = Math.sin(r);
-					bone.a = cos * a - sin * c;
-					bone.b = cos * b - sin * d;
-					bone.c = sin * a + cos * c;
-					bone.d = sin * b + cos * d;
+					var rx = rotation + shearX - prx;
+					var ry = rotation + shearY - prx + 90;
+					var la = spine.MathUtils.cosDeg(rx) * scaleX;
+					var lb = spine.MathUtils.cosDeg(ry) * scaleY;
+					var lc = spine.MathUtils.sinDeg(rx) * scaleX;
+					var ld = spine.MathUtils.sinDeg(ry) * scaleY;
+					this.a = pa * la - pb * lc;
+					this.b = pa * lb - pb * ld;
+					this.c = pc * la + pd * lc;
+					this.d = pc * lb + pd * ld;
+					break;
+				}
+				case spine.TransformMode.NoScale:
+				case spine.TransformMode.NoScaleOrReflection: {
+					var cos = spine.MathUtils.cosDeg(rotation);
+					var sin = spine.MathUtils.sinDeg(rotation);
+					var za = pa * cos + pb * sin;
+					var zc = pc * cos + pd * sin;
+					var s = Math.sqrt(za * za + zc * zc);
+					if (s > 0.00001)
+						s = 1 / s;
+					za *= s;
+					zc *= s;
+					s = Math.sqrt(za * za + zc * zc);
+					var r = Math.PI / 2 + Math.atan2(zc, za);
+					var zb = Math.cos(r) * s;
+					var zd = Math.sin(r) * s;
+					var la = spine.MathUtils.cosDeg(shearX) * scaleX;
+					var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;
+					var lc = spine.MathUtils.sinDeg(shearX) * scaleX;
+					var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;
+					this.a = za * la + zb * lc;
+					this.b = za * lb + zb * ld;
+					this.c = zc * la + zd * lc;
+					this.d = zc * lb + zd * ld;
+					if (this.data.transformMode != spine.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : this.skeleton.flipX != this.skeleton.flipY) {
+						this.b = -this.b;
+						this.d = -this.d;
+					}
+					return;
 				}
 				}
-				bone.appliedValid = false;
+			}
+			if (this.skeleton.flipX) {
+				this.a = -this.a;
+				this.b = -this.b;
+			}
+			if (this.skeleton.flipY) {
+				this.c = -this.c;
+				this.d = -this.d;
 			}
 			}
 		};
 		};
-		PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {
-			var target = this.target;
-			var position = this.position;
-			var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;
-			var closed = path.closed;
-			var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;
-			if (!path.constantSpeed) {
-				var lengths = path.lengths;
-				curveCount -= closed ? 1 : 2;
-				var pathLength_1 = lengths[curveCount];
-				if (percentPosition)
-					position *= pathLength_1;
-				if (percentSpacing) {
-					for (var i = 0; i < spacesCount; i++)
-						spaces[i] *= pathLength_1;
-				}
-				world = spine.Utils.setArraySize(this.world, 8);
-				for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {
-					var space = spaces[i];
-					position += space;
-					var p = position;
-					if (closed) {
-						p %= pathLength_1;
-						if (p < 0)
-							p += pathLength_1;
-						curve = 0;
-					}
-					else if (p < 0) {
-						if (prevCurve != PathConstraint.BEFORE) {
-							prevCurve = PathConstraint.BEFORE;
-							path.computeWorldVertices(target, 2, 4, world, 0, 2);
-						}
-						this.addBeforePosition(p, world, 0, out, o);
-						continue;
-					}
-					else if (p > pathLength_1) {
-						if (prevCurve != PathConstraint.AFTER) {
-							prevCurve = PathConstraint.AFTER;
-							path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);
-						}
-						this.addAfterPosition(p - pathLength_1, world, 0, out, o);
-						continue;
-					}
-					for (;; curve++) {
-						var length_4 = lengths[curve];
-						if (p > length_4)
-							continue;
-						if (curve == 0)
-							p /= length_4;
-						else {
-							var prev = lengths[curve - 1];
-							p = (p - prev) / (length_4 - prev);
-						}
-						break;
-					}
-					if (curve != prevCurve) {
-						prevCurve = curve;
-						if (closed && curve == curveCount) {
-							path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);
-							path.computeWorldVertices(target, 0, 4, world, 4, 2);
-						}
-						else
-							path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);
-					}
-					this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));
-				}
-				return out;
+		Bone.prototype.setToSetupPose = function () {
+			var data = this.data;
+			this.x = data.x;
+			this.y = data.y;
+			this.rotation = data.rotation;
+			this.scaleX = data.scaleX;
+			this.scaleY = data.scaleY;
+			this.shearX = data.shearX;
+			this.shearY = data.shearY;
+		};
+		Bone.prototype.getWorldRotationX = function () {
+			return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;
+		};
+		Bone.prototype.getWorldRotationY = function () {
+			return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg;
+		};
+		Bone.prototype.getWorldScaleX = function () {
+			return Math.sqrt(this.a * this.a + this.c * this.c);
+		};
+		Bone.prototype.getWorldScaleY = function () {
+			return Math.sqrt(this.b * this.b + this.d * this.d);
+		};
+		Bone.prototype.updateAppliedTransform = function () {
+			this.appliedValid = true;
+			var parent = this.parent;
+			if (parent == null) {
+				this.ax = this.worldX;
+				this.ay = this.worldY;
+				this.arotation = Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;
+				this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);
+				this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);
+				this.ashearX = 0;
+				this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg;
+				return;
 			}
 			}
-			if (closed) {
-				verticesLength += 2;
-				world = spine.Utils.setArraySize(this.world, verticesLength);
-				path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);
-				path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);
-				world[verticesLength - 2] = world[0];
-				world[verticesLength - 1] = world[1];
+			var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
+			var pid = 1 / (pa * pd - pb * pc);
+			var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;
+			this.ax = (dx * pd * pid - dy * pb * pid);
+			this.ay = (dy * pa * pid - dx * pc * pid);
+			var ia = pid * pd;
+			var id = pid * pa;
+			var ib = pid * pb;
+			var ic = pid * pc;
+			var ra = ia * this.a - ib * this.c;
+			var rb = ia * this.b - ib * this.d;
+			var rc = id * this.c - ic * this.a;
+			var rd = id * this.d - ic * this.b;
+			this.ashearX = 0;
+			this.ascaleX = Math.sqrt(ra * ra + rc * rc);
+			if (this.ascaleX > 0.0001) {
+				var det = ra * rd - rb * rc;
+				this.ascaleY = det / this.ascaleX;
+				this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg;
+				this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg;
 			}
 			}
 			else {
 			else {
-				curveCount--;
-				verticesLength -= 4;
-				world = spine.Utils.setArraySize(this.world, verticesLength);
-				path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);
-			}
-			var curves = spine.Utils.setArraySize(this.curves, curveCount);
-			var pathLength = 0;
-			var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;
-			var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;
-			for (var i = 0, w = 2; i < curveCount; i++, w += 6) {
-				cx1 = world[w];
-				cy1 = world[w + 1];
-				cx2 = world[w + 2];
-				cy2 = world[w + 3];
-				x2 = world[w + 4];
-				y2 = world[w + 5];
-				tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;
-				tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;
-				dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;
-				dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;
-				ddfx = tmpx * 2 + dddfx;
-				ddfy = tmpy * 2 + dddfy;
-				dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;
-				dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;
-				pathLength += Math.sqrt(dfx * dfx + dfy * dfy);
-				dfx += ddfx;
-				dfy += ddfy;
-				ddfx += dddfx;
-				ddfy += dddfy;
-				pathLength += Math.sqrt(dfx * dfx + dfy * dfy);
-				dfx += ddfx;
-				dfy += ddfy;
-				pathLength += Math.sqrt(dfx * dfx + dfy * dfy);
-				dfx += ddfx + dddfx;
-				dfy += ddfy + dddfy;
-				pathLength += Math.sqrt(dfx * dfx + dfy * dfy);
-				curves[i] = pathLength;
-				x1 = x2;
-				y1 = y2;
-			}
-			if (percentPosition)
-				position *= pathLength;
-			if (percentSpacing) {
-				for (var i = 0; i < spacesCount; i++)
-					spaces[i] *= pathLength;
-			}
-			var segments = this.segments;
-			var curveLength = 0;
-			for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {
-				var space = spaces[i];
-				position += space;
-				var p = position;
-				if (closed) {
-					p %= pathLength;
-					if (p < 0)
-						p += pathLength;
-					curve = 0;
-				}
-				else if (p < 0) {
-					this.addBeforePosition(p, world, 0, out, o);
-					continue;
-				}
-				else if (p > pathLength) {
-					this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);
-					continue;
-				}
-				for (;; curve++) {
-					var length_5 = curves[curve];
-					if (p > length_5)
-						continue;
-					if (curve == 0)
-						p /= length_5;
-					else {
-						var prev = curves[curve - 1];
-						p = (p - prev) / (length_5 - prev);
-					}
-					break;
-				}
-				if (curve != prevCurve) {
-					prevCurve = curve;
-					var ii = curve * 6;
-					x1 = world[ii];
-					y1 = world[ii + 1];
-					cx1 = world[ii + 2];
-					cy1 = world[ii + 3];
-					cx2 = world[ii + 4];
-					cy2 = world[ii + 5];
-					x2 = world[ii + 6];
-					y2 = world[ii + 7];
-					tmpx = (x1 - cx1 * 2 + cx2) * 0.03;
-					tmpy = (y1 - cy1 * 2 + cy2) * 0.03;
-					dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;
-					dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;
-					ddfx = tmpx * 2 + dddfx;
-					ddfy = tmpy * 2 + dddfy;
-					dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;
-					dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;
-					curveLength = Math.sqrt(dfx * dfx + dfy * dfy);
-					segments[0] = curveLength;
-					for (ii = 1; ii < 8; ii++) {
-						dfx += ddfx;
-						dfy += ddfy;
-						ddfx += dddfx;
-						ddfy += dddfy;
-						curveLength += Math.sqrt(dfx * dfx + dfy * dfy);
-						segments[ii] = curveLength;
-					}
-					dfx += ddfx;
-					dfy += ddfy;
-					curveLength += Math.sqrt(dfx * dfx + dfy * dfy);
-					segments[8] = curveLength;
-					dfx += ddfx + dddfx;
-					dfy += ddfy + dddfy;
-					curveLength += Math.sqrt(dfx * dfx + dfy * dfy);
-					segments[9] = curveLength;
-					segment = 0;
-				}
-				p *= curveLength;
-				for (;; segment++) {
-					var length_6 = segments[segment];
-					if (p > length_6)
-						continue;
-					if (segment == 0)
-						p /= length_6;
-					else {
-						var prev = segments[segment - 1];
-						p = segment + (p - prev) / (length_6 - prev);
-					}
-					break;
-				}
-				this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));
+				this.ascaleX = 0;
+				this.ascaleY = Math.sqrt(rb * rb + rd * rd);
+				this.ashearY = 0;
+				this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg;
 			}
 			}
-			return out;
 		};
 		};
-		PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {
-			var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);
-			out[o] = x1 + p * Math.cos(r);
-			out[o + 1] = y1 + p * Math.sin(r);
-			out[o + 2] = r;
+		Bone.prototype.worldToLocal = function (world) {
+			var a = this.a, b = this.b, c = this.c, d = this.d;
+			var invDet = 1 / (a * d - b * c);
+			var x = world.x - this.worldX, y = world.y - this.worldY;
+			world.x = (x * d * invDet - y * b * invDet);
+			world.y = (y * a * invDet - x * c * invDet);
+			return world;
 		};
 		};
-		PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {
-			var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);
-			out[o] = x1 + p * Math.cos(r);
-			out[o + 1] = y1 + p * Math.sin(r);
-			out[o + 2] = r;
+		Bone.prototype.localToWorld = function (local) {
+			var x = local.x, y = local.y;
+			local.x = x * this.a + y * this.b + this.worldX;
+			local.y = x * this.c + y * this.d + this.worldY;
+			return local;
 		};
 		};
-		PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {
-			if (p == 0 || isNaN(p))
-				p = 0.0001;
-			var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
-			var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
-			var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
-			out[o] = x;
-			out[o + 1] = y;
-			if (tangents)
-				out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
+		Bone.prototype.worldToLocalRotation = function (worldRotation) {
+			var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation);
+			return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg;
 		};
 		};
-		PathConstraint.prototype.getOrder = function () {
-			return this.data.order;
+		Bone.prototype.localToWorldRotation = function (localRotation) {
+			var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation);
+			return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg;
 		};
 		};
-		return PathConstraint;
+		Bone.prototype.rotateWorld = function (degrees) {
+			var a = this.a, b = this.b, c = this.c, d = this.d;
+			var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees);
+			this.a = cos * a - sin * c;
+			this.b = cos * b - sin * d;
+			this.c = sin * a + cos * c;
+			this.d = sin * b + cos * d;
+			this.appliedValid = false;
+		};
+		return Bone;
 	}());
 	}());
-	PathConstraint.NONE = -1;
-	PathConstraint.BEFORE = -2;
-	PathConstraint.AFTER = -3;
-	spine.PathConstraint = PathConstraint;
+	spine.Bone = Bone;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var PathConstraintData = (function () {
-		function PathConstraintData(name) {
-			this.order = 0;
-			this.bones = new Array();
+	var BoneData = (function () {
+		function BoneData(index, name, parent) {
+			this.x = 0;
+			this.y = 0;
+			this.rotation = 0;
+			this.scaleX = 1;
+			this.scaleY = 1;
+			this.shearX = 0;
+			this.shearY = 0;
+			this.transformMode = TransformMode.Normal;
+			if (index < 0)
+				throw new Error("index must be >= 0.");
+			if (name == null)
+				throw new Error("name cannot be null.");
+			this.index = index;
 			this.name = name;
 			this.name = name;
+			this.parent = parent;
 		}
 		}
-		return PathConstraintData;
+		return BoneData;
 	}());
 	}());
-	spine.PathConstraintData = PathConstraintData;
-	var PositionMode;
-	(function (PositionMode) {
-		PositionMode[PositionMode["Fixed"] = 0] = "Fixed";
-		PositionMode[PositionMode["Percent"] = 1] = "Percent";
-	})(PositionMode = spine.PositionMode || (spine.PositionMode = {}));
-	var SpacingMode;
-	(function (SpacingMode) {
-		SpacingMode[SpacingMode["Length"] = 0] = "Length";
-		SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed";
-		SpacingMode[SpacingMode["Percent"] = 2] = "Percent";
-	})(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {}));
-	var RotateMode;
-	(function (RotateMode) {
-		RotateMode[RotateMode["Tangent"] = 0] = "Tangent";
-		RotateMode[RotateMode["Chain"] = 1] = "Chain";
-		RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale";
-	})(RotateMode = spine.RotateMode || (spine.RotateMode = {}));
+	spine.BoneData = BoneData;
+	(function (TransformMode) {
+		TransformMode[TransformMode["Normal"] = 0] = "Normal";
+		TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation";
+		TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection";
+		TransformMode[TransformMode["NoScale"] = 3] = "NoScale";
+		TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection";
+	})(spine.TransformMode || (spine.TransformMode = {}));
+	var TransformMode = spine.TransformMode;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var Assets = (function () {
-		function Assets(clientId) {
-			this.toLoad = new Array();
-			this.assets = {};
-			this.clientId = clientId;
+	var Event = (function () {
+		function Event(time, data) {
+			if (data == null)
+				throw new Error("data cannot be null.");
+			this.time = time;
+			this.data = data;
 		}
 		}
-		Assets.prototype.loaded = function () {
-			var i = 0;
-			for (var v in this.assets)
-				i++;
-			return i;
-		};
-		return Assets;
+		return Event;
 	}());
 	}());
-	var SharedAssetManager = (function () {
-		function SharedAssetManager(pathPrefix) {
-			if (pathPrefix === void 0) { pathPrefix = ""; }
-			this.clientAssets = {};
-			this.queuedAssets = {};
-			this.rawAssets = {};
-			this.errors = {};
-			this.pathPrefix = pathPrefix;
+	spine.Event = Event;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var EventData = (function () {
+		function EventData(name) {
+			this.name = name;
 		}
 		}
-		SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) {
-			var clientAssets = this.clientAssets[clientId];
-			if (clientAssets === null || clientAssets === undefined) {
-				clientAssets = new Assets(clientId);
-				this.clientAssets[clientId] = clientAssets;
-			}
-			if (textureLoader !== null)
-				clientAssets.textureLoader = textureLoader;
-			clientAssets.toLoad.push(path);
-			if (this.queuedAssets[path] === path) {
-				return false;
-			}
-			else {
-				this.queuedAssets[path] = path;
-				return true;
-			}
-		};
-		SharedAssetManager.prototype.loadText = function (clientId, path) {
-			var _this = this;
-			path = this.pathPrefix + path;
-			if (!this.queueAsset(clientId, null, path))
-				return;
-			var request = new XMLHttpRequest();
-			request.onreadystatechange = function () {
-				if (request.readyState == XMLHttpRequest.DONE) {
-					if (request.status >= 200 && request.status < 300) {
-						_this.rawAssets[path] = request.responseText;
-					}
-					else {
-						_this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText;
-					}
-				}
-			};
-			request.open("GET", path, true);
-			request.send();
-		};
-		SharedAssetManager.prototype.loadJson = function (clientId, path) {
-			var _this = this;
-			path = this.pathPrefix + path;
-			if (!this.queueAsset(clientId, null, path))
-				return;
-			var request = new XMLHttpRequest();
-			request.onreadystatechange = function () {
-				if (request.readyState == XMLHttpRequest.DONE) {
-					if (request.status >= 200 && request.status < 300) {
-						_this.rawAssets[path] = JSON.parse(request.responseText);
-					}
-					else {
-						_this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText;
-					}
-				}
-			};
-			request.open("GET", path, true);
-			request.send();
-		};
-		SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) {
-			var _this = this;
-			path = this.pathPrefix + path;
-			if (!this.queueAsset(clientId, textureLoader, path))
-				return;
-			var img = new Image();
-			img.src = path;
-			img.crossOrigin = "anonymous";
-			img.onload = function (ev) {
-				_this.rawAssets[path] = img;
-			};
-			img.onerror = function (ev) {
-				_this.errors[path] = "Couldn't load image " + path;
-			};
-		};
-		SharedAssetManager.prototype.get = function (clientId, path) {
-			path = this.pathPrefix + path;
-			var clientAssets = this.clientAssets[clientId];
-			if (clientAssets === null || clientAssets === undefined)
-				return true;
-			return clientAssets.assets[path];
-		};
-		SharedAssetManager.prototype.updateClientAssets = function (clientAssets) {
-			for (var i = 0; i < clientAssets.toLoad.length; i++) {
-				var path = clientAssets.toLoad[i];
-				var asset = clientAssets.assets[path];
-				if (asset === null || asset === undefined) {
-					var rawAsset = this.rawAssets[path];
-					if (rawAsset === null || rawAsset === undefined)
-						continue;
-					if (rawAsset instanceof HTMLImageElement) {
-						clientAssets.assets[path] = clientAssets.textureLoader(rawAsset);
-					}
-					else {
-						clientAssets.assets[path] = rawAsset;
-					}
-				}
-			}
-		};
-		SharedAssetManager.prototype.isLoadingComplete = function (clientId) {
-			var clientAssets = this.clientAssets[clientId];
-			if (clientAssets === null || clientAssets === undefined)
-				return true;
-			this.updateClientAssets(clientAssets);
-			return clientAssets.toLoad.length == clientAssets.loaded();
-		};
-		SharedAssetManager.prototype.dispose = function () {
-		};
-		SharedAssetManager.prototype.hasErrors = function () {
-			return Object.keys(this.errors).length > 0;
-		};
-		SharedAssetManager.prototype.getErrors = function () {
-			return this.errors;
-		};
-		return SharedAssetManager;
+		return EventData;
 	}());
 	}());
-	spine.SharedAssetManager = SharedAssetManager;
+	spine.EventData = EventData;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var Skeleton = (function () {
-		function Skeleton(data) {
-			this._updateCache = new Array();
-			this.updateCacheReset = new Array();
-			this.time = 0;
-			this.flipX = false;
-			this.flipY = false;
-			this.x = 0;
-			this.y = 0;
+	var IkConstraint = (function () {
+		function IkConstraint(data, skeleton) {
+			this.mix = 1;
+			this.bendDirection = 0;
 			if (data == null)
 			if (data == null)
 				throw new Error("data cannot be null.");
 				throw new Error("data cannot be null.");
+			if (skeleton == null)
+				throw new Error("skeleton cannot be null.");
 			this.data = data;
 			this.data = data;
+			this.mix = data.mix;
+			this.bendDirection = data.bendDirection;
 			this.bones = new Array();
 			this.bones = new Array();
-			for (var i = 0; i < data.bones.length; i++) {
-				var boneData = data.bones[i];
-				var bone = void 0;
-				if (boneData.parent == null)
-					bone = new spine.Bone(boneData, this, null);
-				else {
-					var parent_1 = this.bones[boneData.parent.index];
-					bone = new spine.Bone(boneData, this, parent_1);
-					parent_1.children.push(bone);
-				}
-				this.bones.push(bone);
-			}
-			this.slots = new Array();
-			this.drawOrder = new Array();
-			for (var i = 0; i < data.slots.length; i++) {
-				var slotData = data.slots[i];
-				var bone = this.bones[slotData.boneData.index];
-				var slot = new spine.Slot(slotData, bone);
-				this.slots.push(slot);
-				this.drawOrder.push(slot);
-			}
-			this.ikConstraints = new Array();
-			for (var i = 0; i < data.ikConstraints.length; i++) {
-				var ikConstraintData = data.ikConstraints[i];
-				this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this));
-			}
-			this.transformConstraints = new Array();
-			for (var i = 0; i < data.transformConstraints.length; i++) {
-				var transformConstraintData = data.transformConstraints[i];
-				this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this));
-			}
-			this.pathConstraints = new Array();
-			for (var i = 0; i < data.pathConstraints.length; i++) {
-				var pathConstraintData = data.pathConstraints[i];
-				this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this));
-			}
-			this.color = new spine.Color(1, 1, 1, 1);
-			this.updateCache();
+			for (var i = 0; i < data.bones.length; i++)
+				this.bones.push(skeleton.findBone(data.bones[i].name));
+			this.target = skeleton.findBone(data.target.name);
 		}
 		}
-		Skeleton.prototype.updateCache = function () {
-			var updateCache = this._updateCache;
-			updateCache.length = 0;
-			this.updateCacheReset.length = 0;
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++)
-				bones[i].sorted = false;
-			var ikConstraints = this.ikConstraints;
-			var transformConstraints = this.transformConstraints;
-			var pathConstraints = this.pathConstraints;
-			var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;
-			var constraintCount = ikCount + transformCount + pathCount;
-			outer: for (var i = 0; i < constraintCount; i++) {
-				for (var ii = 0; ii < ikCount; ii++) {
-					var constraint = ikConstraints[ii];
-					if (constraint.data.order == i) {
-						this.sortIkConstraint(constraint);
-						continue outer;
-					}
-				}
-				for (var ii = 0; ii < transformCount; ii++) {
-					var constraint = transformConstraints[ii];
-					if (constraint.data.order == i) {
-						this.sortTransformConstraint(constraint);
-						continue outer;
-					}
-				}
-				for (var ii = 0; ii < pathCount; ii++) {
-					var constraint = pathConstraints[ii];
-					if (constraint.data.order == i) {
-						this.sortPathConstraint(constraint);
-						continue outer;
-					}
-				}
-			}
-			for (var i = 0, n = bones.length; i < n; i++)
-				this.sortBone(bones[i]);
-		};
-		Skeleton.prototype.sortIkConstraint = function (constraint) {
-			var target = constraint.target;
-			this.sortBone(target);
-			var constrained = constraint.bones;
-			var parent = constrained[0];
-			this.sortBone(parent);
-			if (constrained.length > 1) {
-				var child = constrained[constrained.length - 1];
-				if (!(this._updateCache.indexOf(child) > -1))
-					this.updateCacheReset.push(child);
-			}
-			this._updateCache.push(constraint);
-			this.sortReset(parent.children);
-			constrained[constrained.length - 1].sorted = true;
+		IkConstraint.prototype.getOrder = function () {
+			return this.data.order;
 		};
 		};
-		Skeleton.prototype.sortPathConstraint = function (constraint) {
-			var slot = constraint.target;
-			var slotIndex = slot.data.index;
-			var slotBone = slot.bone;
-			if (this.skin != null)
-				this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);
-			if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)
-				this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);
-			for (var i = 0, n = this.data.skins.length; i < n; i++)
-				this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);
-			var attachment = slot.getAttachment();
-			if (attachment instanceof spine.PathAttachment)
-				this.sortPathConstraintAttachmentWith(attachment, slotBone);
-			var constrained = constraint.bones;
-			var boneCount = constrained.length;
-			for (var i = 0; i < boneCount; i++)
-				this.sortBone(constrained[i]);
-			this._updateCache.push(constraint);
-			for (var i = 0; i < boneCount; i++)
-				this.sortReset(constrained[i].children);
-			for (var i = 0; i < boneCount; i++)
-				constrained[i].sorted = true;
+		IkConstraint.prototype.apply = function () {
+			this.update();
 		};
 		};
-		Skeleton.prototype.sortTransformConstraint = function (constraint) {
-			this.sortBone(constraint.target);
-			var constrained = constraint.bones;
-			var boneCount = constrained.length;
-			if (constraint.data.local) {
-				for (var i = 0; i < boneCount; i++) {
-					var child = constrained[i];
-					this.sortBone(child.parent);
-					if (!(this._updateCache.indexOf(child) > -1))
-						this.updateCacheReset.push(child);
-				}
-			}
-			else {
-				for (var i = 0; i < boneCount; i++) {
-					this.sortBone(constrained[i]);
-				}
+		IkConstraint.prototype.update = function () {
+			var target = this.target;
+			var bones = this.bones;
+			switch (bones.length) {
+				case 1:
+					this.apply1(bones[0], target.worldX, target.worldY, this.mix);
+					break;
+				case 2:
+					this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix);
+					break;
 			}
 			}
-			this._updateCache.push(constraint);
-			for (var ii = 0; ii < boneCount; ii++)
-				this.sortReset(constrained[ii].children);
-			for (var ii = 0; ii < boneCount; ii++)
-				constrained[ii].sorted = true;
 		};
 		};
-		Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {
-			var attachments = skin.attachments[slotIndex];
-			if (!attachments)
-				return;
-			for (var key in attachments) {
-				this.sortPathConstraintAttachmentWith(attachments[key], slotBone);
-			}
+		IkConstraint.prototype.apply1 = function (bone, targetX, targetY, alpha) {
+			if (!bone.appliedValid)
+				bone.updateAppliedTransform();
+			var p = bone.parent;
+			var id = 1 / (p.a * p.d - p.b * p.c);
+			var x = targetX - p.worldX, y = targetY - p.worldY;
+			var tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay;
+			var rotationIK = Math.atan2(ty, tx) * spine.MathUtils.radDeg - bone.ashearX - bone.arotation;
+			if (bone.ascaleX < 0)
+				rotationIK += 180;
+			if (rotationIK > 180)
+				rotationIK -= 360;
+			else if (rotationIK < -180)
+				rotationIK += 360;
+			bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, bone.ascaleX, bone.ascaleY, bone.ashearX, bone.ashearY);
 		};
 		};
-		Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {
-			if (!(attachment instanceof spine.PathAttachment))
+		IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, alpha) {
+			if (alpha == 0) {
+				child.updateWorldTransform();
 				return;
 				return;
-			var pathBones = attachment.bones;
-			if (pathBones == null)
-				this.sortBone(slotBone);
-			else {
-				var bones = this.bones;
-				var i = 0;
-				while (i < pathBones.length) {
-					var boneCount = pathBones[i++];
-					for (var n = i + boneCount; i < n; i++) {
-						var boneIndex = pathBones[i];
-						this.sortBone(bones[boneIndex]);
-					}
-				}
 			}
 			}
-		};
-		Skeleton.prototype.sortBone = function (bone) {
-			if (bone.sorted)
-				return;
-			var parent = bone.parent;
-			if (parent != null)
-				this.sortBone(parent);
-			bone.sorted = true;
-			this._updateCache.push(bone);
-		};
-		Skeleton.prototype.sortReset = function (bones) {
-			for (var i = 0, n = bones.length; i < n; i++) {
-				var bone = bones[i];
-				if (bone.sorted)
-					this.sortReset(bone.children);
-				bone.sorted = false;
+			if (!parent.appliedValid)
+				parent.updateAppliedTransform();
+			if (!child.appliedValid)
+				child.updateAppliedTransform();
+			var px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, csx = child.ascaleX;
+			var os1 = 0, os2 = 0, s2 = 0;
+			if (psx < 0) {
+				psx = -psx;
+				os1 = 180;
+				s2 = -1;
 			}
 			}
-		};
-		Skeleton.prototype.updateWorldTransform = function () {
-			var updateCacheReset = this.updateCacheReset;
-			for (var i = 0, n = updateCacheReset.length; i < n; i++) {
-				var bone = updateCacheReset[i];
-				bone.ax = bone.x;
-				bone.ay = bone.y;
-				bone.arotation = bone.rotation;
-				bone.ascaleX = bone.scaleX;
-				bone.ascaleY = bone.scaleY;
-				bone.ashearX = bone.shearX;
-				bone.ashearY = bone.shearY;
-				bone.appliedValid = true;
+			else {
+				os1 = 0;
+				s2 = 1;
 			}
 			}
-			var updateCache = this._updateCache;
-			for (var i = 0, n = updateCache.length; i < n; i++)
-				updateCache[i].update();
-		};
-		Skeleton.prototype.setToSetupPose = function () {
-			this.setBonesToSetupPose();
-			this.setSlotsToSetupPose();
-		};
-		Skeleton.prototype.setBonesToSetupPose = function () {
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++)
-				bones[i].setToSetupPose();
-			var ikConstraints = this.ikConstraints;
-			for (var i = 0, n = ikConstraints.length; i < n; i++) {
-				var constraint = ikConstraints[i];
-				constraint.bendDirection = constraint.data.bendDirection;
-				constraint.mix = constraint.data.mix;
+			if (psy < 0) {
+				psy = -psy;
+				s2 = -s2;
 			}
 			}
-			var transformConstraints = this.transformConstraints;
-			for (var i = 0, n = transformConstraints.length; i < n; i++) {
-				var constraint = transformConstraints[i];
-				var data = constraint.data;
-				constraint.rotateMix = data.rotateMix;
-				constraint.translateMix = data.translateMix;
-				constraint.scaleMix = data.scaleMix;
-				constraint.shearMix = data.shearMix;
+			if (csx < 0) {
+				csx = -csx;
+				os2 = 180;
 			}
 			}
-			var pathConstraints = this.pathConstraints;
-			for (var i = 0, n = pathConstraints.length; i < n; i++) {
-				var constraint = pathConstraints[i];
-				var data = constraint.data;
-				constraint.position = data.position;
-				constraint.spacing = data.spacing;
-				constraint.rotateMix = data.rotateMix;
-				constraint.translateMix = data.translateMix;
+			else
+				os2 = 0;
+			var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;
+			var u = Math.abs(psx - psy) <= 0.0001;
+			if (!u) {
+				cy = 0;
+				cwx = a * cx + parent.worldX;
+				cwy = c * cx + parent.worldY;
 			}
 			}
-		};
-		Skeleton.prototype.setSlotsToSetupPose = function () {
-			var slots = this.slots;
-			spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);
-			for (var i = 0, n = slots.length; i < n; i++)
-				slots[i].setToSetupPose();
-		};
-		Skeleton.prototype.getRootBone = function () {
-			if (this.bones.length == 0)
-				return null;
-			return this.bones[0];
-		};
-		Skeleton.prototype.findBone = function (boneName) {
-			if (boneName == null)
-				throw new Error("boneName cannot be null.");
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++) {
-				var bone = bones[i];
-				if (bone.data.name == boneName)
-					return bone;
+			else {
+				cy = child.ay;
+				cwx = a * cx + b * cy + parent.worldX;
+				cwy = c * cx + d * cy + parent.worldY;
 			}
 			}
-			return null;
-		};
-		Skeleton.prototype.findBoneIndex = function (boneName) {
-			if (boneName == null)
-				throw new Error("boneName cannot be null.");
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++)
-				if (bones[i].data.name == boneName)
-					return i;
-			return -1;
-		};
-		Skeleton.prototype.findSlot = function (slotName) {
-			if (slotName == null)
-				throw new Error("slotName cannot be null.");
-			var slots = this.slots;
-			for (var i = 0, n = slots.length; i < n; i++) {
-				var slot = slots[i];
-				if (slot.data.name == slotName)
-					return slot;
+			var pp = parent.parent;
+			a = pp.a;
+			b = pp.b;
+			c = pp.c;
+			d = pp.d;
+			var id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY;
+			var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;
+			x = cwx - pp.worldX;
+			y = cwy - pp.worldY;
+			var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;
+			var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;
+			outer: if (u) {
+				l2 *= psx;
+				var cos = (tx * tx + ty * ty - l1 * l1 - l2 * l2) / (2 * l1 * l2);
+				if (cos < -1)
+					cos = -1;
+				else if (cos > 1)
+					cos = 1;
+				a2 = Math.acos(cos) * bendDir;
+				a = l1 + l2 * cos;
+				b = l2 * Math.sin(a2);
+				a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);
 			}
 			}
-			return null;
-		};
-		Skeleton.prototype.findSlotIndex = function (slotName) {
-			if (slotName == null)
-				throw new Error("slotName cannot be null.");
-			var slots = this.slots;
-			for (var i = 0, n = slots.length; i < n; i++)
-				if (slots[i].data.name == slotName)
-					return i;
-			return -1;
-		};
-		Skeleton.prototype.setSkinByName = function (skinName) {
-			var skin = this.data.findSkin(skinName);
-			if (skin == null)
-				throw new Error("Skin not found: " + skinName);
-			this.setSkin(skin);
-		};
-		Skeleton.prototype.setSkin = function (newSkin) {
-			if (newSkin != null) {
-				if (this.skin != null)
-					newSkin.attachAll(this, this.skin);
-				else {
-					var slots = this.slots;
-					for (var i = 0, n = slots.length; i < n; i++) {
-						var slot = slots[i];
-						var name_1 = slot.data.attachmentName;
-						if (name_1 != null) {
-							var attachment = newSkin.getAttachment(i, name_1);
-							if (attachment != null)
-								slot.setAttachment(attachment);
-						}
+			else {
+				a = psx * l2;
+				b = psy * l2;
+				var aa = a * a, bb = b * b, dd = tx * tx + ty * ty, ta = Math.atan2(ty, tx);
+				c = bb * l1 * l1 + aa * dd - aa * bb;
+				var c1 = -2 * bb * l1, c2 = bb - aa;
+				d = c1 * c1 - 4 * c2 * c;
+				if (d >= 0) {
+					var q = Math.sqrt(d);
+					if (c1 < 0)
+						q = -q;
+					q = -(c1 + q) / 2;
+					var r0 = q / c2, r1 = c / q;
+					var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;
+					if (r * r <= dd) {
+						y = Math.sqrt(dd - r * r) * bendDir;
+						a1 = ta - Math.atan2(y, r);
+						a2 = Math.atan2(y / psy, (r - l1) / psx);
+						break outer;
 					}
 					}
 				}
 				}
-			}
-			this.skin = newSkin;
-		};
-		Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {
-			return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);
-		};
-		Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {
-			if (attachmentName == null)
-				throw new Error("attachmentName cannot be null.");
-			if (this.skin != null) {
-				var attachment = this.skin.getAttachment(slotIndex, attachmentName);
-				if (attachment != null)
-					return attachment;
-			}
-			if (this.data.defaultSkin != null)
-				return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);
-			return null;
-		};
-		Skeleton.prototype.setAttachment = function (slotName, attachmentName) {
-			if (slotName == null)
-				throw new Error("slotName cannot be null.");
-			var slots = this.slots;
-			for (var i = 0, n = slots.length; i < n; i++) {
-				var slot = slots[i];
-				if (slot.data.name == slotName) {
-					var attachment = null;
-					if (attachmentName != null) {
-						attachment = this.getAttachment(i, attachmentName);
-						if (attachment == null)
-							throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName);
+				var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;
+				var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;
+				c = -a * l1 / (aa - bb);
+				if (c >= -1 && c <= 1) {
+					c = Math.acos(c);
+					x = a * Math.cos(c) + l1;
+					y = b * Math.sin(c);
+					d = x * x + y * y;
+					if (d < minDist) {
+						minAngle = c;
+						minDist = d;
+						minX = x;
+						minY = y;
+					}
+					if (d > maxDist) {
+						maxAngle = c;
+						maxDist = d;
+						maxX = x;
+						maxY = y;
 					}
 					}
-					slot.setAttachment(attachment);
-					return;
-				}
-			}
-			throw new Error("Slot not found: " + slotName);
-		};
-		Skeleton.prototype.findIkConstraint = function (constraintName) {
-			if (constraintName == null)
-				throw new Error("constraintName cannot be null.");
-			var ikConstraints = this.ikConstraints;
-			for (var i = 0, n = ikConstraints.length; i < n; i++) {
-				var ikConstraint = ikConstraints[i];
-				if (ikConstraint.data.name == constraintName)
-					return ikConstraint;
-			}
-			return null;
-		};
-		Skeleton.prototype.findTransformConstraint = function (constraintName) {
-			if (constraintName == null)
-				throw new Error("constraintName cannot be null.");
-			var transformConstraints = this.transformConstraints;
-			for (var i = 0, n = transformConstraints.length; i < n; i++) {
-				var constraint = transformConstraints[i];
-				if (constraint.data.name == constraintName)
-					return constraint;
-			}
-			return null;
-		};
-		Skeleton.prototype.findPathConstraint = function (constraintName) {
-			if (constraintName == null)
-				throw new Error("constraintName cannot be null.");
-			var pathConstraints = this.pathConstraints;
-			for (var i = 0, n = pathConstraints.length; i < n; i++) {
-				var constraint = pathConstraints[i];
-				if (constraint.data.name == constraintName)
-					return constraint;
-			}
-			return null;
-		};
-		Skeleton.prototype.getBounds = function (offset, size, temp) {
-			if (offset == null)
-				throw new Error("offset cannot be null.");
-			if (size == null)
-				throw new Error("size cannot be null.");
-			var drawOrder = this.drawOrder;
-			var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;
-			for (var i = 0, n = drawOrder.length; i < n; i++) {
-				var slot = drawOrder[i];
-				var verticesLength = 0;
-				var vertices = null;
-				var attachment = slot.getAttachment();
-				if (attachment instanceof spine.RegionAttachment) {
-					verticesLength = 8;
-					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
-					attachment.computeWorldVertices(slot.bone, vertices, 0, 2);
 				}
 				}
-				else if (attachment instanceof spine.MeshAttachment) {
-					var mesh = attachment;
-					verticesLength = mesh.worldVerticesLength;
-					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
-					mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
+				if (dd <= (minDist + maxDist) / 2) {
+					a1 = ta - Math.atan2(minY * bendDir, minX);
+					a2 = minAngle * bendDir;
 				}
 				}
-				if (vertices != null) {
-					for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
-						var x = vertices[ii], y = vertices[ii + 1];
-						minX = Math.min(minX, x);
-						minY = Math.min(minY, y);
-						maxX = Math.max(maxX, x);
-						maxY = Math.max(maxY, y);
-					}
+				else {
+					a1 = ta - Math.atan2(maxY * bendDir, maxX);
+					a2 = maxAngle * bendDir;
 				}
 				}
 			}
 			}
-			offset.set(minX, minY);
-			size.set(maxX - minX, maxY - minY);
-		};
-		Skeleton.prototype.update = function (delta) {
-			this.time += delta;
+			var os = Math.atan2(cy, cx) * s2;
+			var rotation = parent.arotation;
+			a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation;
+			if (a1 > 180)
+				a1 -= 360;
+			else if (a1 < -180)
+				a1 += 360;
+			parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, parent.ascaleX, parent.ascaleY, 0, 0);
+			rotation = child.arotation;
+			a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;
+			if (a2 > 180)
+				a2 -= 360;
+			else if (a2 < -180)
+				a2 += 360;
+			child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);
 		};
 		};
-		return Skeleton;
+		return IkConstraint;
 	}());
 	}());
-	spine.Skeleton = Skeleton;
+	spine.IkConstraint = IkConstraint;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var SkeletonBounds = (function () {
-		function SkeletonBounds() {
-			this.minX = 0;
-			this.minY = 0;
-			this.maxX = 0;
-			this.maxY = 0;
-			this.boundingBoxes = new Array();
-			this.polygons = new Array();
-			this.polygonPool = new spine.Pool(function () {
-				return spine.Utils.newFloatArray(16);
-			});
-		}
-		SkeletonBounds.prototype.update = function (skeleton, updateAabb) {
-			if (skeleton == null)
-				throw new Error("skeleton cannot be null.");
-			var boundingBoxes = this.boundingBoxes;
-			var polygons = this.polygons;
-			var polygonPool = this.polygonPool;
-			var slots = skeleton.slots;
-			var slotCount = slots.length;
-			boundingBoxes.length = 0;
-			polygonPool.freeAll(polygons);
-			polygons.length = 0;
-			for (var i = 0; i < slotCount; i++) {
-				var slot = slots[i];
-				var attachment = slot.getAttachment();
-				if (attachment instanceof spine.BoundingBoxAttachment) {
-					var boundingBox = attachment;
-					boundingBoxes.push(boundingBox);
-					var polygon = polygonPool.obtain();
-					if (polygon.length != boundingBox.worldVerticesLength) {
-						polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength);
-					}
-					polygons.push(polygon);
-					boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);
+	var IkConstraintData = (function () {
+		function IkConstraintData(name) {
+			this.order = 0;
+			this.bones = new Array();
+			this.bendDirection = 1;
+			this.mix = 1;
+			this.name = name;
+		}
+		return IkConstraintData;
+	}());
+	spine.IkConstraintData = IkConstraintData;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var PathConstraint = (function () {
+		function PathConstraint(data, skeleton) {
+			this.position = 0;
+			this.spacing = 0;
+			this.rotateMix = 0;
+			this.translateMix = 0;
+			this.spaces = new Array();
+			this.positions = new Array();
+			this.world = new Array();
+			this.curves = new Array();
+			this.lengths = new Array();
+			this.segments = new Array();
+			if (data == null)
+				throw new Error("data cannot be null.");
+			if (skeleton == null)
+				throw new Error("skeleton cannot be null.");
+			this.data = data;
+			this.bones = new Array();
+			for (var i = 0, n = data.bones.length; i < n; i++)
+				this.bones.push(skeleton.findBone(data.bones[i].name));
+			this.target = skeleton.findSlot(data.target.name);
+			this.position = data.position;
+			this.spacing = data.spacing;
+			this.rotateMix = data.rotateMix;
+			this.translateMix = data.translateMix;
+		}
+		PathConstraint.prototype.apply = function () {
+			this.update();
+		};
+		PathConstraint.prototype.update = function () {
+			var attachment = this.target.getAttachment();
+			if (!(attachment instanceof spine.PathAttachment))
+				return;
+			var rotateMix = this.rotateMix, translateMix = this.translateMix;
+			var translate = translateMix > 0, rotate = rotateMix > 0;
+			if (!translate && !rotate)
+				return;
+			var data = this.data;
+			var spacingMode = data.spacingMode;
+			var lengthSpacing = spacingMode == spine.SpacingMode.Length;
+			var rotateMode = data.rotateMode;
+			var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale;
+			var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;
+			var bones = this.bones;
+			var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null;
+			var spacing = this.spacing;
+			if (scale || lengthSpacing) {
+				if (scale)
+					lengths = spine.Utils.setArraySize(this.lengths, boneCount);
+				for (var i = 0, n = spacesCount - 1; i < n;) {
+					var bone = bones[i];
+					var setupLength = bone.data.length, x = setupLength * bone.a, y = setupLength * bone.c;
+					var length_1 = Math.sqrt(x * x + y * y);
+					if (scale)
+						lengths[i] = length_1;
+					spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_1 / setupLength;
 				}
 				}
 			}
 			}
-			if (updateAabb) {
-				this.aabbCompute();
-			}
 			else {
 			else {
-				this.minX = Number.POSITIVE_INFINITY;
-				this.minY = Number.POSITIVE_INFINITY;
-				this.maxX = Number.NEGATIVE_INFINITY;
-				this.maxY = Number.NEGATIVE_INFINITY;
+				for (var i = 1; i < spacesCount; i++)
+					spaces[i] = spacing;
 			}
 			}
-		};
-		SkeletonBounds.prototype.aabbCompute = function () {
-			var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;
-			var polygons = this.polygons;
-			for (var i = 0, n = polygons.length; i < n; i++) {
-				var polygon = polygons[i];
-				var vertices = polygon;
-				for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {
-					var x = vertices[ii];
-					var y = vertices[ii + 1];
-					minX = Math.min(minX, x);
-					minY = Math.min(minY, y);
-					maxX = Math.max(maxX, x);
-					maxY = Math.max(maxY, y);
-				}
+			var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, spacingMode == spine.SpacingMode.Percent);
+			var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;
+			var tip = false;
+			if (offsetRotation == 0)
+				tip = rotateMode == spine.RotateMode.Chain;
+			else {
+				tip = false;
+				var p = this.target.bone;
+				offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;
 			}
 			}
-			this.minX = minX;
-			this.minY = minY;
-			this.maxX = maxX;
-			this.maxY = maxY;
-		};
-		SkeletonBounds.prototype.aabbContainsPoint = function (x, y) {
-			return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;
-		};
-		SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {
-			var minX = this.minX;
-			var minY = this.minY;
-			var maxX = this.maxX;
-			var maxY = this.maxY;
-			if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))
-				return false;
-			var m = (y2 - y1) / (x2 - x1);
-			var y = m * (minX - x1) + y1;
-			if (y > minY && y < maxY)
-				return true;
-			y = m * (maxX - x1) + y1;
-			if (y > minY && y < maxY)
-				return true;
-			var x = (minY - y1) / m + x1;
-			if (x > minX && x < maxX)
-				return true;
-			x = (maxY - y1) / m + x1;
-			if (x > minX && x < maxX)
-				return true;
-			return false;
-		};
-		SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) {
-			return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;
-		};
-		SkeletonBounds.prototype.containsPoint = function (x, y) {
-			var polygons = this.polygons;
-			for (var i = 0, n = polygons.length; i < n; i++)
-				if (this.containsPointPolygon(polygons[i], x, y))
-					return this.boundingBoxes[i];
-			return null;
-		};
-		SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) {
-			var vertices = polygon;
-			var nn = polygon.length;
-			var prevIndex = nn - 2;
-			var inside = false;
-			for (var ii = 0; ii < nn; ii += 2) {
-				var vertexY = vertices[ii + 1];
-				var prevY = vertices[prevIndex + 1];
-				if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {
-					var vertexX = vertices[ii];
-					if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)
-						inside = !inside;
+			for (var i = 0, p = 3; i < boneCount; i++, p += 3) {
+				var bone = bones[i];
+				bone.worldX += (boneX - bone.worldX) * translateMix;
+				bone.worldY += (boneY - bone.worldY) * translateMix;
+				var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;
+				if (scale) {
+					var length_2 = lengths[i];
+					if (length_2 != 0) {
+						var s = (Math.sqrt(dx * dx + dy * dy) / length_2 - 1) * rotateMix + 1;
+						bone.a *= s;
+						bone.c *= s;
+					}
 				}
 				}
-				prevIndex = ii;
-			}
-			return inside;
-		};
-		SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) {
-			var polygons = this.polygons;
-			for (var i = 0, n = polygons.length; i < n; i++)
-				if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))
-					return this.boundingBoxes[i];
-			return null;
-		};
-		SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {
-			var vertices = polygon;
-			var nn = polygon.length;
-			var width12 = x1 - x2, height12 = y1 - y2;
-			var det1 = x1 * y2 - y1 * x2;
-			var x3 = vertices[nn - 2], y3 = vertices[nn - 1];
-			for (var ii = 0; ii < nn; ii += 2) {
-				var x4 = vertices[ii], y4 = vertices[ii + 1];
-				var det2 = x3 * y4 - y3 * x4;
-				var width34 = x3 - x4, height34 = y3 - y4;
-				var det3 = width12 * height34 - height12 * width34;
-				var x = (det1 * width34 - width12 * det2) / det3;
-				if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {
-					var y = (det1 * height34 - height12 * det2) / det3;
-					if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))
-						return true;
+				boneX = x;
+				boneY = y;
+				if (rotate) {
+					var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;
+					if (tangents)
+						r = positions[p - 1];
+					else if (spaces[i + 1] == 0)
+						r = positions[p + 2];
+					else
+						r = Math.atan2(dy, dx);
+					r -= Math.atan2(c, a);
+					if (tip) {
+						cos = Math.cos(r);
+						sin = Math.sin(r);
+						var length_3 = bone.data.length;
+						boneX += (length_3 * (cos * a - sin * c) - dx) * rotateMix;
+						boneY += (length_3 * (sin * a + cos * c) - dy) * rotateMix;
+					}
+					else {
+						r += offsetRotation;
+					}
+					if (r > spine.MathUtils.PI)
+						r -= spine.MathUtils.PI2;
+					else if (r < -spine.MathUtils.PI)
+						r += spine.MathUtils.PI2;
+					r *= rotateMix;
+					cos = Math.cos(r);
+					sin = Math.sin(r);
+					bone.a = cos * a - sin * c;
+					bone.b = cos * b - sin * d;
+					bone.c = sin * a + cos * c;
+					bone.d = sin * b + cos * d;
 				}
 				}
-				x3 = x4;
-				y3 = y4;
+				bone.appliedValid = false;
 			}
 			}
-			return false;
 		};
 		};
-		SkeletonBounds.prototype.getPolygon = function (boundingBox) {
-			if (boundingBox == null)
-				throw new Error("boundingBox cannot be null.");
-			var index = this.boundingBoxes.indexOf(boundingBox);
-			return index == -1 ? null : this.polygons[index];
-		};
-		SkeletonBounds.prototype.getWidth = function () {
-			return this.maxX - this.minX;
-		};
-		SkeletonBounds.prototype.getHeight = function () {
-			return this.maxY - this.minY;
-		};
-		return SkeletonBounds;
-	}());
-	spine.SkeletonBounds = SkeletonBounds;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var SkeletonClipping = (function () {
-		function SkeletonClipping() {
-			this.triangulator = new spine.Triangulator();
-			this.clippingPolygon = new Array();
-			this.clipOutput = new Array();
-			this.clippedVertices = new Array();
-			this.clippedTriangles = new Array();
-			this.scratch = new Array();
-		}
-		SkeletonClipping.prototype.clipStart = function (slot, clip) {
-			if (this.clipAttachment != null)
-				return 0;
-			this.clipAttachment = clip;
-			var n = clip.worldVerticesLength;
-			var vertices = spine.Utils.setArraySize(this.clippingPolygon, n);
-			clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);
-			var clippingPolygon = this.clippingPolygon;
-			SkeletonClipping.makeClockwise(clippingPolygon);
-			var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));
-			for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) {
-				var polygon = clippingPolygons[i];
-				SkeletonClipping.makeClockwise(polygon);
-				polygon.push(polygon[0]);
-				polygon.push(polygon[1]);
-			}
-			return clippingPolygons.length;
-		};
-		SkeletonClipping.prototype.clipEndWithSlot = function (slot) {
-			if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data)
-				this.clipEnd();
-		};
-		SkeletonClipping.prototype.clipEnd = function () {
-			if (this.clipAttachment == null)
-				return;
-			this.clipAttachment = null;
-			this.clippingPolygons = null;
-			this.clippedVertices.length = 0;
-			this.clippedTriangles.length = 0;
-			this.clippingPolygon.length = 0;
-		};
-		SkeletonClipping.prototype.isClipping = function () {
-			return this.clipAttachment != null;
-		};
-		SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) {
-			var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
-			var clippedTriangles = this.clippedTriangles;
-			var polygons = this.clippingPolygons;
-			var polygonsCount = this.clippingPolygons.length;
-			var vertexSize = twoColor ? 12 : 8;
-			var index = 0;
-			clippedVertices.length = 0;
-			clippedTriangles.length = 0;
-			outer: for (var i = 0; i < trianglesLength; i += 3) {
-				var vertexOffset = triangles[i] << 1;
-				var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
-				var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];
-				vertexOffset = triangles[i + 1] << 1;
-				var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];
-				var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];
-				vertexOffset = triangles[i + 2] << 1;
-				var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];
-				var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];
-				for (var p = 0; p < polygonsCount; p++) {
-					var s = clippedVertices.length;
-					if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {
-						var clipOutputLength = clipOutput.length;
-						if (clipOutputLength == 0)
-							continue;
-						var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;
-						var d = 1 / (d0 * d2 + d1 * (y1 - y3));
-						var clipOutputCount = clipOutputLength >> 1;
-						var clipOutputItems = this.clipOutput;
-						var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);
-						for (var ii = 0; ii < clipOutputLength; ii += 2) {
-							var x = clipOutputItems[ii], y = clipOutputItems[ii + 1];
-							clippedVerticesItems[s] = x;
-							clippedVerticesItems[s + 1] = y;
-							clippedVerticesItems[s + 2] = light.r;
-							clippedVerticesItems[s + 3] = light.g;
-							clippedVerticesItems[s + 4] = light.b;
-							clippedVerticesItems[s + 5] = light.a;
-							var c0 = x - x3, c1 = y - y3;
-							var a = (d0 * c0 + d1 * c1) * d;
-							var b = (d4 * c0 + d2 * c1) * d;
-							var c = 1 - a - b;
-							clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;
-							clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;
-							if (twoColor) {
-								clippedVerticesItems[s + 8] = dark.r;
-								clippedVerticesItems[s + 8] = dark.g;
-								clippedVerticesItems[s + 10] = dark.b;
-								clippedVerticesItems[s + 11] = dark.a;
-							}
-							s += vertexSize;
-						}
-						s = clippedTriangles.length;
-						var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));
-						clipOutputCount--;
-						for (var ii = 1; ii < clipOutputCount; ii++) {
-							clippedTrianglesItems[s] = index;
-							clippedTrianglesItems[s + 1] = (index + ii);
-							clippedTrianglesItems[s + 2] = (index + ii + 1);
-							s += 3;
+		PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {
+			var target = this.target;
+			var position = this.position;
+			var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;
+			var closed = path.closed;
+			var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;
+			if (!path.constantSpeed) {
+				var lengths = path.lengths;
+				curveCount -= closed ? 1 : 2;
+				var pathLength_1 = lengths[curveCount];
+				if (percentPosition)
+					position *= pathLength_1;
+				if (percentSpacing) {
+					for (var i = 0; i < spacesCount; i++)
+						spaces[i] *= pathLength_1;
+				}
+				world = spine.Utils.setArraySize(this.world, 8);
+				for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {
+					var space = spaces[i];
+					position += space;
+					var p = position;
+					if (closed) {
+						p %= pathLength_1;
+						if (p < 0)
+							p += pathLength_1;
+						curve = 0;
+					}
+					else if (p < 0) {
+						if (prevCurve != PathConstraint.BEFORE) {
+							prevCurve = PathConstraint.BEFORE;
+							path.computeWorldVertices(target, 2, 4, world, 0, 2);
 						}
 						}
-						index += clipOutputCount + 1;
+						this.addBeforePosition(p, world, 0, out, o);
+						continue;
 					}
 					}
-					else {
-						var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize);
-						clippedVerticesItems[s] = x1;
-						clippedVerticesItems[s + 1] = y1;
-						clippedVerticesItems[s + 2] = light.r;
-						clippedVerticesItems[s + 3] = light.g;
-						clippedVerticesItems[s + 4] = light.b;
-						clippedVerticesItems[s + 5] = light.a;
-						if (!twoColor) {
-							clippedVerticesItems[s + 6] = u1;
-							clippedVerticesItems[s + 7] = v1;
-							clippedVerticesItems[s + 8] = x2;
-							clippedVerticesItems[s + 9] = y2;
-							clippedVerticesItems[s + 10] = light.r;
-							clippedVerticesItems[s + 11] = light.g;
-							clippedVerticesItems[s + 12] = light.b;
-							clippedVerticesItems[s + 13] = light.a;
-							clippedVerticesItems[s + 14] = u2;
-							clippedVerticesItems[s + 15] = v2;
-							clippedVerticesItems[s + 16] = x3;
-							clippedVerticesItems[s + 17] = y3;
-							clippedVerticesItems[s + 18] = light.r;
-							clippedVerticesItems[s + 19] = light.g;
-							clippedVerticesItems[s + 20] = light.b;
-							clippedVerticesItems[s + 21] = light.a;
-							clippedVerticesItems[s + 22] = u3;
-							clippedVerticesItems[s + 23] = v3;
+					else if (p > pathLength_1) {
+						if (prevCurve != PathConstraint.AFTER) {
+							prevCurve = PathConstraint.AFTER;
+							path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);
 						}
 						}
+						this.addAfterPosition(p - pathLength_1, world, 0, out, o);
+						continue;
+					}
+					for (;; curve++) {
+						var length_4 = lengths[curve];
+						if (p > length_4)
+							continue;
+						if (curve == 0)
+							p /= length_4;
 						else {
 						else {
-							clippedVerticesItems[s + 6] = u1;
-							clippedVerticesItems[s + 7] = v1;
-							clippedVerticesItems[s + 8] = dark.r;
-							clippedVerticesItems[s + 9] = dark.g;
-							clippedVerticesItems[s + 10] = dark.b;
-							clippedVerticesItems[s + 11] = dark.a;
-							clippedVerticesItems[s + 12] = x2;
-							clippedVerticesItems[s + 13] = y2;
-							clippedVerticesItems[s + 14] = light.r;
-							clippedVerticesItems[s + 15] = light.g;
-							clippedVerticesItems[s + 16] = light.b;
-							clippedVerticesItems[s + 17] = light.a;
-							clippedVerticesItems[s + 18] = u2;
-							clippedVerticesItems[s + 19] = v2;
-							clippedVerticesItems[s + 20] = dark.r;
-							clippedVerticesItems[s + 21] = dark.g;
-							clippedVerticesItems[s + 22] = dark.b;
-							clippedVerticesItems[s + 23] = dark.a;
-							clippedVerticesItems[s + 24] = x3;
-							clippedVerticesItems[s + 25] = y3;
-							clippedVerticesItems[s + 26] = light.r;
-							clippedVerticesItems[s + 27] = light.g;
-							clippedVerticesItems[s + 28] = light.b;
-							clippedVerticesItems[s + 29] = light.a;
-							clippedVerticesItems[s + 30] = u3;
-							clippedVerticesItems[s + 31] = v3;
-							clippedVerticesItems[s + 32] = dark.r;
-							clippedVerticesItems[s + 33] = dark.g;
-							clippedVerticesItems[s + 34] = dark.b;
-							clippedVerticesItems[s + 35] = dark.a;
+							var prev = lengths[curve - 1];
+							p = (p - prev) / (length_4 - prev);
 						}
 						}
-						s = clippedTriangles.length;
-						var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3);
-						clippedTrianglesItems[s] = index;
-						clippedTrianglesItems[s + 1] = (index + 1);
-						clippedTrianglesItems[s + 2] = (index + 2);
-						index += 3;
-						continue outer;
+						break;
+					}
+					if (curve != prevCurve) {
+						prevCurve = curve;
+						if (closed && curve == curveCount) {
+							path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);
+							path.computeWorldVertices(target, 0, 4, world, 4, 2);
+						}
+						else
+							path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);
 					}
 					}
+					this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));
 				}
 				}
+				return out;
 			}
 			}
-		};
-		SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) {
-			var originalOutput = output;
-			var clipped = false;
-			var input = null;
-			if (clippingArea.length % 4 >= 2) {
-				input = output;
-				output = this.scratch;
+			if (closed) {
+				verticesLength += 2;
+				world = spine.Utils.setArraySize(this.world, verticesLength);
+				path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);
+				path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);
+				world[verticesLength - 2] = world[0];
+				world[verticesLength - 1] = world[1];
 			}
 			}
-			else
-				input = this.scratch;
-			input.length = 0;
-			input.push(x1);
-			input.push(y1);
-			input.push(x2);
-			input.push(y2);
-			input.push(x3);
-			input.push(y3);
-			input.push(x1);
-			input.push(y1);
-			output.length = 0;
-			var clippingVertices = clippingArea;
-			var clippingVerticesLast = clippingArea.length - 4;
-			for (var i = 0;; i += 2) {
-				var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];
-				var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3];
-				var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2;
-				var inputVertices = input;
-				var inputVerticesLength = input.length - 2, outputStart = output.length;
-				for (var ii = 0; ii < inputVerticesLength; ii += 2) {
-					var inputX = inputVertices[ii], inputY = inputVertices[ii + 1];
-					var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3];
-					var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;
-					if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {
-						if (side2) {
-							output.push(inputX2);
-							output.push(inputY2);
-							continue;
-						}
-						var c0 = inputY2 - inputY, c2 = inputX2 - inputX;
-						var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / (c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY));
-						output.push(edgeX + (edgeX2 - edgeX) * ua);
-						output.push(edgeY + (edgeY2 - edgeY) * ua);
-					}
-					else if (side2) {
-						var c0 = inputY2 - inputY, c2 = inputX2 - inputX;
-						var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / (c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY));
-						output.push(edgeX + (edgeX2 - edgeX) * ua);
-						output.push(edgeY + (edgeY2 - edgeY) * ua);
-						output.push(inputX2);
-						output.push(inputY2);
+			else {
+				curveCount--;
+				verticesLength -= 4;
+				world = spine.Utils.setArraySize(this.world, verticesLength);
+				path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);
+			}
+			var curves = spine.Utils.setArraySize(this.curves, curveCount);
+			var pathLength = 0;
+			var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;
+			var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;
+			for (var i = 0, w = 2; i < curveCount; i++, w += 6) {
+				cx1 = world[w];
+				cy1 = world[w + 1];
+				cx2 = world[w + 2];
+				cy2 = world[w + 3];
+				x2 = world[w + 4];
+				y2 = world[w + 5];
+				tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;
+				tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;
+				dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;
+				dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;
+				ddfx = tmpx * 2 + dddfx;
+				ddfy = tmpy * 2 + dddfy;
+				dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;
+				dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;
+				pathLength += Math.sqrt(dfx * dfx + dfy * dfy);
+				dfx += ddfx;
+				dfy += ddfy;
+				ddfx += dddfx;
+				ddfy += dddfy;
+				pathLength += Math.sqrt(dfx * dfx + dfy * dfy);
+				dfx += ddfx;
+				dfy += ddfy;
+				pathLength += Math.sqrt(dfx * dfx + dfy * dfy);
+				dfx += ddfx + dddfx;
+				dfy += ddfy + dddfy;
+				pathLength += Math.sqrt(dfx * dfx + dfy * dfy);
+				curves[i] = pathLength;
+				x1 = x2;
+				y1 = y2;
+			}
+			if (percentPosition)
+				position *= pathLength;
+			if (percentSpacing) {
+				for (var i = 0; i < spacesCount; i++)
+					spaces[i] *= pathLength;
+			}
+			var segments = this.segments;
+			var curveLength = 0;
+			for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {
+				var space = spaces[i];
+				position += space;
+				var p = position;
+				if (closed) {
+					p %= pathLength;
+					if (p < 0)
+						p += pathLength;
+					curve = 0;
+				}
+				else if (p < 0) {
+					this.addBeforePosition(p, world, 0, out, o);
+					continue;
+				}
+				else if (p > pathLength) {
+					this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);
+					continue;
+				}
+				for (;; curve++) {
+					var length_5 = curves[curve];
+					if (p > length_5)
+						continue;
+					if (curve == 0)
+						p /= length_5;
+					else {
+						var prev = curves[curve - 1];
+						p = (p - prev) / (length_5 - prev);
 					}
 					}
-					clipped = true;
+					break;
 				}
 				}
-				if (outputStart == output.length) {
-					originalOutput.length = 0;
-					return true;
+				if (curve != prevCurve) {
+					prevCurve = curve;
+					var ii = curve * 6;
+					x1 = world[ii];
+					y1 = world[ii + 1];
+					cx1 = world[ii + 2];
+					cy1 = world[ii + 3];
+					cx2 = world[ii + 4];
+					cy2 = world[ii + 5];
+					x2 = world[ii + 6];
+					y2 = world[ii + 7];
+					tmpx = (x1 - cx1 * 2 + cx2) * 0.03;
+					tmpy = (y1 - cy1 * 2 + cy2) * 0.03;
+					dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;
+					dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;
+					ddfx = tmpx * 2 + dddfx;
+					ddfy = tmpy * 2 + dddfy;
+					dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;
+					dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;
+					curveLength = Math.sqrt(dfx * dfx + dfy * dfy);
+					segments[0] = curveLength;
+					for (ii = 1; ii < 8; ii++) {
+						dfx += ddfx;
+						dfy += ddfy;
+						ddfx += dddfx;
+						ddfy += dddfy;
+						curveLength += Math.sqrt(dfx * dfx + dfy * dfy);
+						segments[ii] = curveLength;
+					}
+					dfx += ddfx;
+					dfy += ddfy;
+					curveLength += Math.sqrt(dfx * dfx + dfy * dfy);
+					segments[8] = curveLength;
+					dfx += ddfx + dddfx;
+					dfy += ddfy + dddfy;
+					curveLength += Math.sqrt(dfx * dfx + dfy * dfy);
+					segments[9] = curveLength;
+					segment = 0;
 				}
 				}
-				output.push(output[0]);
-				output.push(output[1]);
-				if (i == clippingVerticesLast)
+				p *= curveLength;
+				for (;; segment++) {
+					var length_6 = segments[segment];
+					if (p > length_6)
+						continue;
+					if (segment == 0)
+						p /= length_6;
+					else {
+						var prev = segments[segment - 1];
+						p = segment + (p - prev) / (length_6 - prev);
+					}
 					break;
 					break;
-				var temp = output;
-				output = input;
-				output.length = 0;
-				input = temp;
-			}
-			if (originalOutput != output) {
-				originalOutput.length = 0;
-				for (var i = 0, n = output.length - 2; i < n; i++)
-					originalOutput[i] = output[i];
+				}
+				this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));
 			}
 			}
-			else
-				originalOutput.length = originalOutput.length - 2;
-			return clipped;
+			return out;
 		};
 		};
-		SkeletonClipping.makeClockwise = function (polygon) {
-			var vertices = polygon;
-			var verticeslength = polygon.length;
-			var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;
-			for (var i = 0, n = verticeslength - 3; i < n; i += 2) {
-				p1x = vertices[i];
-				p1y = vertices[i + 1];
-				p2x = vertices[i + 2];
-				p2y = vertices[i + 3];
-				area += p1x * p2y - p2x * p1y;
-			}
-			if (area < 0)
-				return;
-			for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {
-				var x = vertices[i], y = vertices[i + 1];
-				var other = lastX - i;
-				vertices[i] = vertices[other];
-				vertices[i + 1] = vertices[other + 1];
-				vertices[other] = x;
-				vertices[other + 1] = y;
-			}
+		PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {
+			var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);
+			out[o] = x1 + p * Math.cos(r);
+			out[o + 1] = y1 + p * Math.sin(r);
+			out[o + 2] = r;
 		};
 		};
-		return SkeletonClipping;
+		PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {
+			var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);
+			out[o] = x1 + p * Math.cos(r);
+			out[o + 1] = y1 + p * Math.sin(r);
+			out[o + 2] = r;
+		};
+		PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {
+			if (p == 0 || isNaN(p))
+				p = 0.0001;
+			var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
+			var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
+			var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
+			out[o] = x;
+			out[o + 1] = y;
+			if (tangents)
+				out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
+		};
+		PathConstraint.prototype.getOrder = function () {
+			return this.data.order;
+		};
+		PathConstraint.NONE = -1;
+		PathConstraint.BEFORE = -2;
+		PathConstraint.AFTER = -3;
+		return PathConstraint;
 	}());
 	}());
-	spine.SkeletonClipping = SkeletonClipping;
+	spine.PathConstraint = PathConstraint;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var SkeletonData = (function () {
-		function SkeletonData() {
+	var PathConstraintData = (function () {
+		function PathConstraintData(name) {
+			this.order = 0;
 			this.bones = new Array();
 			this.bones = new Array();
-			this.slots = new Array();
-			this.skins = new Array();
-			this.events = new Array();
-			this.animations = new Array();
-			this.ikConstraints = new Array();
-			this.transformConstraints = new Array();
-			this.pathConstraints = new Array();
-			this.fps = 0;
+			this.name = name;
 		}
 		}
-		SkeletonData.prototype.findBone = function (boneName) {
-			if (boneName == null)
-				throw new Error("boneName cannot be null.");
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++) {
-				var bone = bones[i];
-				if (bone.name == boneName)
-					return bone;
-			}
-			return null;
-		};
-		SkeletonData.prototype.findBoneIndex = function (boneName) {
-			if (boneName == null)
-				throw new Error("boneName cannot be null.");
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++)
-				if (bones[i].name == boneName)
-					return i;
-			return -1;
+		return PathConstraintData;
+	}());
+	spine.PathConstraintData = PathConstraintData;
+	(function (PositionMode) {
+		PositionMode[PositionMode["Fixed"] = 0] = "Fixed";
+		PositionMode[PositionMode["Percent"] = 1] = "Percent";
+	})(spine.PositionMode || (spine.PositionMode = {}));
+	var PositionMode = spine.PositionMode;
+	(function (SpacingMode) {
+		SpacingMode[SpacingMode["Length"] = 0] = "Length";
+		SpacingMode[SpacingMode["Fixed"] = 1] = "Fixed";
+		SpacingMode[SpacingMode["Percent"] = 2] = "Percent";
+	})(spine.SpacingMode || (spine.SpacingMode = {}));
+	var SpacingMode = spine.SpacingMode;
+	(function (RotateMode) {
+		RotateMode[RotateMode["Tangent"] = 0] = "Tangent";
+		RotateMode[RotateMode["Chain"] = 1] = "Chain";
+		RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale";
+	})(spine.RotateMode || (spine.RotateMode = {}));
+	var RotateMode = spine.RotateMode;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var Assets = (function () {
+		function Assets(clientId) {
+			this.toLoad = new Array();
+			this.assets = {};
+			this.clientId = clientId;
+		}
+		Assets.prototype.loaded = function () {
+			var i = 0;
+			for (var v in this.assets)
+				i++;
+			return i;
 		};
 		};
-		SkeletonData.prototype.findSlot = function (slotName) {
-			if (slotName == null)
-				throw new Error("slotName cannot be null.");
-			var slots = this.slots;
-			for (var i = 0, n = slots.length; i < n; i++) {
-				var slot = slots[i];
-				if (slot.name == slotName)
-					return slot;
+		return Assets;
+	}());
+	var SharedAssetManager = (function () {
+		function SharedAssetManager(pathPrefix) {
+			if (pathPrefix === void 0) { pathPrefix = ""; }
+			this.clientAssets = {};
+			this.queuedAssets = {};
+			this.rawAssets = {};
+			this.errors = {};
+			this.pathPrefix = pathPrefix;
+		}
+		SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) {
+			var clientAssets = this.clientAssets[clientId];
+			if (clientAssets === null || clientAssets === undefined) {
+				clientAssets = new Assets(clientId);
+				this.clientAssets[clientId] = clientAssets;
+			}
+			if (textureLoader !== null)
+				clientAssets.textureLoader = textureLoader;
+			clientAssets.toLoad.push(path);
+			if (this.queuedAssets[path] === path) {
+				return false;
+			}
+			else {
+				this.queuedAssets[path] = path;
+				return true;
 			}
 			}
-			return null;
 		};
 		};
-		SkeletonData.prototype.findSlotIndex = function (slotName) {
-			if (slotName == null)
-				throw new Error("slotName cannot be null.");
-			var slots = this.slots;
-			for (var i = 0, n = slots.length; i < n; i++)
-				if (slots[i].name == slotName)
-					return i;
-			return -1;
+		SharedAssetManager.prototype.loadText = function (clientId, path) {
+			var _this = this;
+			path = this.pathPrefix + path;
+			if (!this.queueAsset(clientId, null, path))
+				return;
+			var request = new XMLHttpRequest();
+			request.onreadystatechange = function () {
+				if (request.readyState == XMLHttpRequest.DONE) {
+					if (request.status >= 200 && request.status < 300) {
+						_this.rawAssets[path] = request.responseText;
+					}
+					else {
+						_this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText;
+					}
+				}
+			};
+			request.open("GET", path, true);
+			request.send();
 		};
 		};
-		SkeletonData.prototype.findSkin = function (skinName) {
-			if (skinName == null)
-				throw new Error("skinName cannot be null.");
-			var skins = this.skins;
-			for (var i = 0, n = skins.length; i < n; i++) {
-				var skin = skins[i];
-				if (skin.name == skinName)
-					return skin;
-			}
-			return null;
+		SharedAssetManager.prototype.loadJson = function (clientId, path) {
+			var _this = this;
+			path = this.pathPrefix + path;
+			if (!this.queueAsset(clientId, null, path))
+				return;
+			var request = new XMLHttpRequest();
+			request.onreadystatechange = function () {
+				if (request.readyState == XMLHttpRequest.DONE) {
+					if (request.status >= 200 && request.status < 300) {
+						_this.rawAssets[path] = JSON.parse(request.responseText);
+					}
+					else {
+						_this.errors[path] = "Couldn't load text " + path + ": status " + request.status + ", " + request.responseText;
+					}
+				}
+			};
+			request.open("GET", path, true);
+			request.send();
 		};
 		};
-		SkeletonData.prototype.findEvent = function (eventDataName) {
-			if (eventDataName == null)
-				throw new Error("eventDataName cannot be null.");
-			var events = this.events;
-			for (var i = 0, n = events.length; i < n; i++) {
-				var event_4 = events[i];
-				if (event_4.name == eventDataName)
-					return event_4;
-			}
-			return null;
+		SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) {
+			var _this = this;
+			path = this.pathPrefix + path;
+			if (!this.queueAsset(clientId, textureLoader, path))
+				return;
+			var img = new Image();
+			img.src = path;
+			img.crossOrigin = "anonymous";
+			img.onload = function (ev) {
+				_this.rawAssets[path] = img;
+			};
+			img.onerror = function (ev) {
+				_this.errors[path] = "Couldn't load image " + path;
+			};
 		};
 		};
-		SkeletonData.prototype.findAnimation = function (animationName) {
-			if (animationName == null)
-				throw new Error("animationName cannot be null.");
-			var animations = this.animations;
-			for (var i = 0, n = animations.length; i < n; i++) {
-				var animation = animations[i];
-				if (animation.name == animationName)
-					return animation;
-			}
-			return null;
+		SharedAssetManager.prototype.get = function (clientId, path) {
+			path = this.pathPrefix + path;
+			var clientAssets = this.clientAssets[clientId];
+			if (clientAssets === null || clientAssets === undefined)
+				return true;
+			return clientAssets.assets[path];
 		};
 		};
-		SkeletonData.prototype.findIkConstraint = function (constraintName) {
-			if (constraintName == null)
-				throw new Error("constraintName cannot be null.");
-			var ikConstraints = this.ikConstraints;
-			for (var i = 0, n = ikConstraints.length; i < n; i++) {
-				var constraint = ikConstraints[i];
-				if (constraint.name == constraintName)
-					return constraint;
+		SharedAssetManager.prototype.updateClientAssets = function (clientAssets) {
+			for (var i = 0; i < clientAssets.toLoad.length; i++) {
+				var path = clientAssets.toLoad[i];
+				var asset = clientAssets.assets[path];
+				if (asset === null || asset === undefined) {
+					var rawAsset = this.rawAssets[path];
+					if (rawAsset === null || rawAsset === undefined)
+						continue;
+					if (rawAsset instanceof HTMLImageElement) {
+						clientAssets.assets[path] = clientAssets.textureLoader(rawAsset);
+					}
+					else {
+						clientAssets.assets[path] = rawAsset;
+					}
+				}
 			}
 			}
-			return null;
 		};
 		};
-		SkeletonData.prototype.findTransformConstraint = function (constraintName) {
-			if (constraintName == null)
-				throw new Error("constraintName cannot be null.");
-			var transformConstraints = this.transformConstraints;
-			for (var i = 0, n = transformConstraints.length; i < n; i++) {
-				var constraint = transformConstraints[i];
-				if (constraint.name == constraintName)
-					return constraint;
-			}
-			return null;
+		SharedAssetManager.prototype.isLoadingComplete = function (clientId) {
+			var clientAssets = this.clientAssets[clientId];
+			if (clientAssets === null || clientAssets === undefined)
+				return true;
+			this.updateClientAssets(clientAssets);
+			return clientAssets.toLoad.length == clientAssets.loaded();
 		};
 		};
-		SkeletonData.prototype.findPathConstraint = function (constraintName) {
-			if (constraintName == null)
-				throw new Error("constraintName cannot be null.");
-			var pathConstraints = this.pathConstraints;
-			for (var i = 0, n = pathConstraints.length; i < n; i++) {
-				var constraint = pathConstraints[i];
-				if (constraint.name == constraintName)
-					return constraint;
-			}
-			return null;
+		SharedAssetManager.prototype.dispose = function () {
 		};
 		};
-		SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {
-			if (pathConstraintName == null)
-				throw new Error("pathConstraintName cannot be null.");
-			var pathConstraints = this.pathConstraints;
-			for (var i = 0, n = pathConstraints.length; i < n; i++)
-				if (pathConstraints[i].name == pathConstraintName)
-					return i;
-			return -1;
+		SharedAssetManager.prototype.hasErrors = function () {
+			return Object.keys(this.errors).length > 0;
 		};
 		};
-		return SkeletonData;
+		SharedAssetManager.prototype.getErrors = function () {
+			return this.errors;
+		};
+		return SharedAssetManager;
 	}());
 	}());
-	spine.SkeletonData = SkeletonData;
+	spine.SharedAssetManager = SharedAssetManager;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var SkeletonJson = (function () {
-		function SkeletonJson(attachmentLoader) {
-			this.scale = 1;
-			this.linkedMeshes = new Array();
-			this.attachmentLoader = attachmentLoader;
-		}
-		SkeletonJson.prototype.readSkeletonData = function (json) {
-			var scale = this.scale;
-			var skeletonData = new spine.SkeletonData();
-			var root = typeof (json) === "string" ? JSON.parse(json) : json;
-			var skeletonMap = root.skeleton;
-			if (skeletonMap != null) {
-				skeletonData.hash = skeletonMap.hash;
-				skeletonData.version = skeletonMap.spine;
-				skeletonData.width = skeletonMap.width;
-				skeletonData.height = skeletonMap.height;
-				skeletonData.fps = skeletonMap.fps;
-				skeletonData.imagesPath = skeletonMap.images;
-			}
-			if (root.bones) {
-				for (var i = 0; i < root.bones.length; i++) {
-					var boneMap = root.bones[i];
-					var parent_2 = null;
-					var parentName = this.getValue(boneMap, "parent", null);
-					if (parentName != null) {
-						parent_2 = skeletonData.findBone(parentName);
-						if (parent_2 == null)
-							throw new Error("Parent bone not found: " + parentName);
-					}
-					var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2);
-					data.length = this.getValue(boneMap, "length", 0) * scale;
-					data.x = this.getValue(boneMap, "x", 0) * scale;
-					data.y = this.getValue(boneMap, "y", 0) * scale;
-					data.rotation = this.getValue(boneMap, "rotation", 0);
-					data.scaleX = this.getValue(boneMap, "scaleX", 1);
-					data.scaleY = this.getValue(boneMap, "scaleY", 1);
-					data.shearX = this.getValue(boneMap, "shearX", 0);
-					data.shearY = this.getValue(boneMap, "shearY", 0);
-					data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal"));
-					skeletonData.bones.push(data);
+	var Skeleton = (function () {
+		function Skeleton(data) {
+			this._updateCache = new Array();
+			this.updateCacheReset = new Array();
+			this.time = 0;
+			this.flipX = false;
+			this.flipY = false;
+			this.x = 0;
+			this.y = 0;
+			if (data == null)
+				throw new Error("data cannot be null.");
+			this.data = data;
+			this.bones = new Array();
+			for (var i = 0; i < data.bones.length; i++) {
+				var boneData = data.bones[i];
+				var bone = void 0;
+				if (boneData.parent == null)
+					bone = new spine.Bone(boneData, this, null);
+				else {
+					var parent_1 = this.bones[boneData.parent.index];
+					bone = new spine.Bone(boneData, this, parent_1);
+					parent_1.children.push(bone);
 				}
 				}
+				this.bones.push(bone);
 			}
 			}
-			if (root.slots) {
-				for (var i = 0; i < root.slots.length; i++) {
-					var slotMap = root.slots[i];
-					var slotName = slotMap.name;
-					var boneName = slotMap.bone;
-					var boneData = skeletonData.findBone(boneName);
-					if (boneData == null)
-						throw new Error("Slot bone not found: " + boneName);
-					var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData);
-					var color = this.getValue(slotMap, "color", null);
-					if (color != null)
-						data.color.setFromString(color);
-					var dark = this.getValue(slotMap, "dark", null);
-					if (dark != null) {
-						data.darkColor = new spine.Color(1, 1, 1, 1);
-						data.darkColor.setFromString(dark);
-					}
-					data.attachmentName = this.getValue(slotMap, "attachment", null);
-					data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal"));
-					skeletonData.slots.push(data);
-				}
+			this.slots = new Array();
+			this.drawOrder = new Array();
+			for (var i = 0; i < data.slots.length; i++) {
+				var slotData = data.slots[i];
+				var bone = this.bones[slotData.boneData.index];
+				var slot = new spine.Slot(slotData, bone);
+				this.slots.push(slot);
+				this.drawOrder.push(slot);
 			}
 			}
-			if (root.ik) {
-				for (var i = 0; i < root.ik.length; i++) {
-					var constraintMap = root.ik[i];
-					var data = new spine.IkConstraintData(constraintMap.name);
-					data.order = this.getValue(constraintMap, "order", 0);
-					for (var j = 0; j < constraintMap.bones.length; j++) {
-						var boneName = constraintMap.bones[j];
-						var bone = skeletonData.findBone(boneName);
-						if (bone == null)
-							throw new Error("IK bone not found: " + boneName);
-						data.bones.push(bone);
-					}
-					var targetName = constraintMap.target;
-					data.target = skeletonData.findBone(targetName);
-					if (data.target == null)
-						throw new Error("IK target bone not found: " + targetName);
-					data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1;
-					data.mix = this.getValue(constraintMap, "mix", 1);
-					skeletonData.ikConstraints.push(data);
-				}
+			this.ikConstraints = new Array();
+			for (var i = 0; i < data.ikConstraints.length; i++) {
+				var ikConstraintData = data.ikConstraints[i];
+				this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this));
 			}
 			}
-			if (root.transform) {
-				for (var i = 0; i < root.transform.length; i++) {
-					var constraintMap = root.transform[i];
-					var data = new spine.TransformConstraintData(constraintMap.name);
-					data.order = this.getValue(constraintMap, "order", 0);
-					for (var j = 0; j < constraintMap.bones.length; j++) {
-						var boneName = constraintMap.bones[j];
-						var bone = skeletonData.findBone(boneName);
-						if (bone == null)
-							throw new Error("Transform constraint bone not found: " + boneName);
-						data.bones.push(bone);
-					}
-					var targetName = constraintMap.target;
-					data.target = skeletonData.findBone(targetName);
-					if (data.target == null)
-						throw new Error("Transform constraint target bone not found: " + targetName);
-					data.local = this.getValue(constraintMap, "local", false);
-					data.relative = this.getValue(constraintMap, "relative", false);
-					data.offsetRotation = this.getValue(constraintMap, "rotation", 0);
-					data.offsetX = this.getValue(constraintMap, "x", 0) * scale;
-					data.offsetY = this.getValue(constraintMap, "y", 0) * scale;
-					data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0);
-					data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0);
-					data.offsetShearY = this.getValue(constraintMap, "shearY", 0);
-					data.rotateMix = this.getValue(constraintMap, "rotateMix", 1);
-					data.translateMix = this.getValue(constraintMap, "translateMix", 1);
-					data.scaleMix = this.getValue(constraintMap, "scaleMix", 1);
-					data.shearMix = this.getValue(constraintMap, "shearMix", 1);
-					skeletonData.transformConstraints.push(data);
-				}
+			this.transformConstraints = new Array();
+			for (var i = 0; i < data.transformConstraints.length; i++) {
+				var transformConstraintData = data.transformConstraints[i];
+				this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this));
 			}
 			}
-			if (root.path) {
-				for (var i = 0; i < root.path.length; i++) {
-					var constraintMap = root.path[i];
-					var data = new spine.PathConstraintData(constraintMap.name);
-					data.order = this.getValue(constraintMap, "order", 0);
-					for (var j = 0; j < constraintMap.bones.length; j++) {
-						var boneName = constraintMap.bones[j];
-						var bone = skeletonData.findBone(boneName);
-						if (bone == null)
-							throw new Error("Transform constraint bone not found: " + boneName);
-						data.bones.push(bone);
-					}
-					var targetName = constraintMap.target;
-					data.target = skeletonData.findSlot(targetName);
-					if (data.target == null)
-						throw new Error("Path target slot not found: " + targetName);
-					data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent"));
-					data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length"));
-					data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent"));
-					data.offsetRotation = this.getValue(constraintMap, "rotation", 0);
-					data.position = this.getValue(constraintMap, "position", 0);
-					if (data.positionMode == spine.PositionMode.Fixed)
-						data.position *= scale;
-					data.spacing = this.getValue(constraintMap, "spacing", 0);
-					if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)
-						data.spacing *= scale;
-					data.rotateMix = this.getValue(constraintMap, "rotateMix", 1);
-					data.translateMix = this.getValue(constraintMap, "translateMix", 1);
-					skeletonData.pathConstraints.push(data);
-				}
+			this.pathConstraints = new Array();
+			for (var i = 0; i < data.pathConstraints.length; i++) {
+				var pathConstraintData = data.pathConstraints[i];
+				this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this));
 			}
 			}
-			if (root.skins) {
-				for (var skinName in root.skins) {
-					var skinMap = root.skins[skinName];
-					var skin = new spine.Skin(skinName);
-					for (var slotName in skinMap) {
-						var slotIndex = skeletonData.findSlotIndex(slotName);
-						if (slotIndex == -1)
-							throw new Error("Slot not found: " + slotName);
-						var slotMap = skinMap[slotName];
-						for (var entryName in slotMap) {
-							var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData);
-							if (attachment != null)
-								skin.addAttachment(slotIndex, entryName, attachment);
-						}
+			this.color = new spine.Color(1, 1, 1, 1);
+			this.updateCache();
+		}
+		Skeleton.prototype.updateCache = function () {
+			var updateCache = this._updateCache;
+			updateCache.length = 0;
+			this.updateCacheReset.length = 0;
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++)
+				bones[i].sorted = false;
+			var ikConstraints = this.ikConstraints;
+			var transformConstraints = this.transformConstraints;
+			var pathConstraints = this.pathConstraints;
+			var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;
+			var constraintCount = ikCount + transformCount + pathCount;
+			outer: for (var i = 0; i < constraintCount; i++) {
+				for (var ii = 0; ii < ikCount; ii++) {
+					var constraint = ikConstraints[ii];
+					if (constraint.data.order == i) {
+						this.sortIkConstraint(constraint);
+						continue outer;
 					}
 					}
-					skeletonData.skins.push(skin);
-					if (skin.name == "default")
-						skeletonData.defaultSkin = skin;
 				}
 				}
-			}
-			for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {
-				var linkedMesh = this.linkedMeshes[i];
-				var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);
-				if (skin == null)
-					throw new Error("Skin not found: " + linkedMesh.skin);
-				var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
-				if (parent_3 == null)
-					throw new Error("Parent mesh not found: " + linkedMesh.parent);
-				linkedMesh.mesh.setParentMesh(parent_3);
-				linkedMesh.mesh.updateUVs();
-			}
-			this.linkedMeshes.length = 0;
-			if (root.events) {
-				for (var eventName in root.events) {
-					var eventMap = root.events[eventName];
-					var data = new spine.EventData(eventName);
-					data.intValue = this.getValue(eventMap, "int", 0);
-					data.floatValue = this.getValue(eventMap, "float", 0);
-					data.stringValue = this.getValue(eventMap, "string", "");
-					skeletonData.events.push(data);
+				for (var ii = 0; ii < transformCount; ii++) {
+					var constraint = transformConstraints[ii];
+					if (constraint.data.order == i) {
+						this.sortTransformConstraint(constraint);
+						continue outer;
+					}
 				}
 				}
-			}
-			if (root.animations) {
-				for (var animationName in root.animations) {
-					var animationMap = root.animations[animationName];
-					this.readAnimation(animationMap, animationName, skeletonData);
+				for (var ii = 0; ii < pathCount; ii++) {
+					var constraint = pathConstraints[ii];
+					if (constraint.data.order == i) {
+						this.sortPathConstraint(constraint);
+						continue outer;
+					}
 				}
 				}
 			}
 			}
-			return skeletonData;
+			for (var i = 0, n = bones.length; i < n; i++)
+				this.sortBone(bones[i]);
 		};
 		};
-		SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {
-			var scale = this.scale;
-			name = this.getValue(map, "name", name);
-			var type = this.getValue(map, "type", "region");
-			switch (type) {
-				case "region": {
-					var path = this.getValue(map, "path", name);
-					var region = this.attachmentLoader.newRegionAttachment(skin, name, path);
-					if (region == null)
-						return null;
-					region.path = path;
-					region.x = this.getValue(map, "x", 0) * scale;
-					region.y = this.getValue(map, "y", 0) * scale;
-					region.scaleX = this.getValue(map, "scaleX", 1);
-					region.scaleY = this.getValue(map, "scaleY", 1);
-					region.rotation = this.getValue(map, "rotation", 0);
-					region.width = map.width * scale;
-					region.height = map.height * scale;
-					var color = this.getValue(map, "color", null);
-					if (color != null)
-						region.color.setFromString(color);
-					region.updateOffset();
-					return region;
-				}
-				case "boundingbox": {
-					var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);
-					if (box == null)
-						return null;
-					this.readVertices(map, box, map.vertexCount << 1);
-					var color = this.getValue(map, "color", null);
-					if (color != null)
-						box.color.setFromString(color);
-					return box;
-				}
-				case "mesh":
-				case "linkedmesh": {
-					var path = this.getValue(map, "path", name);
-					var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);
-					if (mesh == null)
-						return null;
-					mesh.path = path;
-					var color = this.getValue(map, "color", null);
-					if (color != null)
-						mesh.color.setFromString(color);
-					var parent_4 = this.getValue(map, "parent", null);
-					if (parent_4 != null) {
-						mesh.inheritDeform = this.getValue(map, "deform", true);
-						this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4));
-						return mesh;
-					}
-					var uvs = map.uvs;
-					this.readVertices(map, mesh, uvs.length);
-					mesh.triangles = map.triangles;
-					mesh.regionUVs = uvs;
-					mesh.updateUVs();
-					mesh.hullLength = this.getValue(map, "hull", 0) * 2;
-					return mesh;
-				}
-				case "path": {
-					var path = this.attachmentLoader.newPathAttachment(skin, name);
-					if (path == null)
-						return null;
-					path.closed = this.getValue(map, "closed", false);
-					path.constantSpeed = this.getValue(map, "constantSpeed", true);
-					var vertexCount = map.vertexCount;
-					this.readVertices(map, path, vertexCount << 1);
-					var lengths = spine.Utils.newArray(vertexCount / 3, 0);
-					for (var i = 0; i < map.lengths.length; i++)
-						lengths[i++] = map.lengths[i] * scale;
-					path.lengths = lengths;
-					var color = this.getValue(map, "color", null);
-					if (color != null)
-						path.color.setFromString(color);
-					return path;
-				}
-				case "point": {
-					var point = this.attachmentLoader.newPointAttachment(skin, name);
-					if (point == null)
-						return null;
-					point.x = this.getValue(map, "x", 0) * scale;
-					point.y = this.getValue(map, "y", 0) * scale;
-					point.rotation = this.getValue(map, "rotation", 0);
-					var color = this.getValue(map, "color", null);
-					if (color != null)
-						point.color.setFromString(color);
-					return point;
-				}
-				case "clipping": {
-					var clip = this.attachmentLoader.newClippingAttachment(skin, name);
-					if (clip == null)
-						return null;
-					var end = this.getValue(map, "end", null);
-					if (end != null) {
-						var slot = skeletonData.findSlot(end);
-						if (slot == null)
-							throw new Error("Clipping end slot not found: " + end);
-						clip.endSlot = slot;
-					}
-					var vertexCount = map.vertexCount;
-					this.readVertices(map, clip, vertexCount << 1);
-					var color = this.getValue(map, "color", null);
-					if (color != null)
-						clip.color.setFromString(color);
-					return clip;
-				}
+		Skeleton.prototype.sortIkConstraint = function (constraint) {
+			var target = constraint.target;
+			this.sortBone(target);
+			var constrained = constraint.bones;
+			var parent = constrained[0];
+			this.sortBone(parent);
+			if (constrained.length > 1) {
+				var child = constrained[constrained.length - 1];
+				if (!(this._updateCache.indexOf(child) > -1))
+					this.updateCacheReset.push(child);
 			}
 			}
-			return null;
+			this._updateCache.push(constraint);
+			this.sortReset(parent.children);
+			constrained[constrained.length - 1].sorted = true;
 		};
 		};
-		SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {
-			var scale = this.scale;
-			attachment.worldVerticesLength = verticesLength;
-			var vertices = map.vertices;
-			if (verticesLength == vertices.length) {
-				var scaledVertices = spine.Utils.toFloatArray(vertices);
-				if (scale != 1) {
-					for (var i = 0, n = vertices.length; i < n; i++)
-						scaledVertices[i] *= scale;
+		Skeleton.prototype.sortPathConstraint = function (constraint) {
+			var slot = constraint.target;
+			var slotIndex = slot.data.index;
+			var slotBone = slot.bone;
+			if (this.skin != null)
+				this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);
+			if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)
+				this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);
+			for (var i = 0, n = this.data.skins.length; i < n; i++)
+				this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);
+			var attachment = slot.getAttachment();
+			if (attachment instanceof spine.PathAttachment)
+				this.sortPathConstraintAttachmentWith(attachment, slotBone);
+			var constrained = constraint.bones;
+			var boneCount = constrained.length;
+			for (var i = 0; i < boneCount; i++)
+				this.sortBone(constrained[i]);
+			this._updateCache.push(constraint);
+			for (var i = 0; i < boneCount; i++)
+				this.sortReset(constrained[i].children);
+			for (var i = 0; i < boneCount; i++)
+				constrained[i].sorted = true;
+		};
+		Skeleton.prototype.sortTransformConstraint = function (constraint) {
+			this.sortBone(constraint.target);
+			var constrained = constraint.bones;
+			var boneCount = constrained.length;
+			if (constraint.data.local) {
+				for (var i = 0; i < boneCount; i++) {
+					var child = constrained[i];
+					this.sortBone(child.parent);
+					if (!(this._updateCache.indexOf(child) > -1))
+						this.updateCacheReset.push(child);
 				}
 				}
-				attachment.vertices = scaledVertices;
-				return;
 			}
 			}
-			var weights = new Array();
-			var bones = new Array();
-			for (var i = 0, n = vertices.length; i < n;) {
-				var boneCount = vertices[i++];
-				bones.push(boneCount);
-				for (var nn = i + boneCount * 4; i < nn; i += 4) {
-					bones.push(vertices[i]);
-					weights.push(vertices[i + 1] * scale);
-					weights.push(vertices[i + 2] * scale);
-					weights.push(vertices[i + 3]);
+			else {
+				for (var i = 0; i < boneCount; i++) {
+					this.sortBone(constrained[i]);
 				}
 				}
 			}
 			}
-			attachment.bones = bones;
-			attachment.vertices = spine.Utils.toFloatArray(weights);
+			this._updateCache.push(constraint);
+			for (var ii = 0; ii < boneCount; ii++)
+				this.sortReset(constrained[ii].children);
+			for (var ii = 0; ii < boneCount; ii++)
+				constrained[ii].sorted = true;
 		};
 		};
-		SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {
-			var scale = this.scale;
-			var timelines = new Array();
-			var duration = 0;
-			if (map.slots) {
-				for (var slotName in map.slots) {
-					var slotMap = map.slots[slotName];
-					var slotIndex = skeletonData.findSlotIndex(slotName);
-					if (slotIndex == -1)
-						throw new Error("Slot not found: " + slotName);
-					for (var timelineName in slotMap) {
-						var timelineMap = slotMap[timelineName];
-						if (timelineName == "attachment") {
-							var timeline = new spine.AttachmentTimeline(timelineMap.length);
-							timeline.slotIndex = slotIndex;
-							var frameIndex = 0;
-							for (var i = 0; i < timelineMap.length; i++) {
-								var valueMap = timelineMap[i];
-								timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);
-							}
-							timelines.push(timeline);
-							duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
-						}
-						else if (timelineName == "color") {
-							var timeline = new spine.ColorTimeline(timelineMap.length);
-							timeline.slotIndex = slotIndex;
-							var frameIndex = 0;
-							for (var i = 0; i < timelineMap.length; i++) {
-								var valueMap = timelineMap[i];
-								var color = new spine.Color();
-								color.setFromString(valueMap.color);
-								timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);
-								this.readCurve(valueMap, timeline, frameIndex);
-								frameIndex++;
-							}
-							timelines.push(timeline);
-							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]);
-						}
-						else if (timelineName == "twoColor") {
-							var timeline = new spine.TwoColorTimeline(timelineMap.length);
-							timeline.slotIndex = slotIndex;
-							var frameIndex = 0;
-							for (var i = 0; i < timelineMap.length; i++) {
-								var valueMap = timelineMap[i];
-								var light = new spine.Color();
-								var dark = new spine.Color();
-								light.setFromString(valueMap.light);
-								dark.setFromString(valueMap.dark);
-								timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);
-								this.readCurve(valueMap, timeline, frameIndex);
-								frameIndex++;
-							}
-							timelines.push(timeline);
-							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]);
-						}
-						else
-							throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")");
+		Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {
+			var attachments = skin.attachments[slotIndex];
+			if (!attachments)
+				return;
+			for (var key in attachments) {
+				this.sortPathConstraintAttachmentWith(attachments[key], slotBone);
+			}
+		};
+		Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {
+			if (!(attachment instanceof spine.PathAttachment))
+				return;
+			var pathBones = attachment.bones;
+			if (pathBones == null)
+				this.sortBone(slotBone);
+			else {
+				var bones = this.bones;
+				var i = 0;
+				while (i < pathBones.length) {
+					var boneCount = pathBones[i++];
+					for (var n = i + boneCount; i < n; i++) {
+						var boneIndex = pathBones[i];
+						this.sortBone(bones[boneIndex]);
 					}
 					}
 				}
 				}
 			}
 			}
-			if (map.bones) {
-				for (var boneName in map.bones) {
-					var boneMap = map.bones[boneName];
-					var boneIndex = skeletonData.findBoneIndex(boneName);
-					if (boneIndex == -1)
-						throw new Error("Bone not found: " + boneName);
-					for (var timelineName in boneMap) {
-						var timelineMap = boneMap[timelineName];
-						if (timelineName === "rotate") {
-							var timeline = new spine.RotateTimeline(timelineMap.length);
-							timeline.boneIndex = boneIndex;
-							var frameIndex = 0;
-							for (var i = 0; i < timelineMap.length; i++) {
-								var valueMap = timelineMap[i];
-								timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);
-								this.readCurve(valueMap, timeline, frameIndex);
-								frameIndex++;
-							}
-							timelines.push(timeline);
-							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]);
-						}
-						else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") {
-							var timeline = null;
-							var timelineScale = 1;
-							if (timelineName === "scale")
-								timeline = new spine.ScaleTimeline(timelineMap.length);
-							else if (timelineName === "shear")
-								timeline = new spine.ShearTimeline(timelineMap.length);
-							else {
-								timeline = new spine.TranslateTimeline(timelineMap.length);
-								timelineScale = scale;
-							}
-							timeline.boneIndex = boneIndex;
-							var frameIndex = 0;
-							for (var i = 0; i < timelineMap.length; i++) {
-								var valueMap = timelineMap[i];
-								var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0);
-								timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);
-								this.readCurve(valueMap, timeline, frameIndex);
-								frameIndex++;
-							}
-							timelines.push(timeline);
-							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]);
+		};
+		Skeleton.prototype.sortBone = function (bone) {
+			if (bone.sorted)
+				return;
+			var parent = bone.parent;
+			if (parent != null)
+				this.sortBone(parent);
+			bone.sorted = true;
+			this._updateCache.push(bone);
+		};
+		Skeleton.prototype.sortReset = function (bones) {
+			for (var i = 0, n = bones.length; i < n; i++) {
+				var bone = bones[i];
+				if (bone.sorted)
+					this.sortReset(bone.children);
+				bone.sorted = false;
+			}
+		};
+		Skeleton.prototype.updateWorldTransform = function () {
+			var updateCacheReset = this.updateCacheReset;
+			for (var i = 0, n = updateCacheReset.length; i < n; i++) {
+				var bone = updateCacheReset[i];
+				bone.ax = bone.x;
+				bone.ay = bone.y;
+				bone.arotation = bone.rotation;
+				bone.ascaleX = bone.scaleX;
+				bone.ascaleY = bone.scaleY;
+				bone.ashearX = bone.shearX;
+				bone.ashearY = bone.shearY;
+				bone.appliedValid = true;
+			}
+			var updateCache = this._updateCache;
+			for (var i = 0, n = updateCache.length; i < n; i++)
+				updateCache[i].update();
+		};
+		Skeleton.prototype.setToSetupPose = function () {
+			this.setBonesToSetupPose();
+			this.setSlotsToSetupPose();
+		};
+		Skeleton.prototype.setBonesToSetupPose = function () {
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++)
+				bones[i].setToSetupPose();
+			var ikConstraints = this.ikConstraints;
+			for (var i = 0, n = ikConstraints.length; i < n; i++) {
+				var constraint = ikConstraints[i];
+				constraint.bendDirection = constraint.data.bendDirection;
+				constraint.mix = constraint.data.mix;
+			}
+			var transformConstraints = this.transformConstraints;
+			for (var i = 0, n = transformConstraints.length; i < n; i++) {
+				var constraint = transformConstraints[i];
+				var data = constraint.data;
+				constraint.rotateMix = data.rotateMix;
+				constraint.translateMix = data.translateMix;
+				constraint.scaleMix = data.scaleMix;
+				constraint.shearMix = data.shearMix;
+			}
+			var pathConstraints = this.pathConstraints;
+			for (var i = 0, n = pathConstraints.length; i < n; i++) {
+				var constraint = pathConstraints[i];
+				var data = constraint.data;
+				constraint.position = data.position;
+				constraint.spacing = data.spacing;
+				constraint.rotateMix = data.rotateMix;
+				constraint.translateMix = data.translateMix;
+			}
+		};
+		Skeleton.prototype.setSlotsToSetupPose = function () {
+			var slots = this.slots;
+			spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);
+			for (var i = 0, n = slots.length; i < n; i++)
+				slots[i].setToSetupPose();
+		};
+		Skeleton.prototype.getRootBone = function () {
+			if (this.bones.length == 0)
+				return null;
+			return this.bones[0];
+		};
+		Skeleton.prototype.findBone = function (boneName) {
+			if (boneName == null)
+				throw new Error("boneName cannot be null.");
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++) {
+				var bone = bones[i];
+				if (bone.data.name == boneName)
+					return bone;
+			}
+			return null;
+		};
+		Skeleton.prototype.findBoneIndex = function (boneName) {
+			if (boneName == null)
+				throw new Error("boneName cannot be null.");
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++)
+				if (bones[i].data.name == boneName)
+					return i;
+			return -1;
+		};
+		Skeleton.prototype.findSlot = function (slotName) {
+			if (slotName == null)
+				throw new Error("slotName cannot be null.");
+			var slots = this.slots;
+			for (var i = 0, n = slots.length; i < n; i++) {
+				var slot = slots[i];
+				if (slot.data.name == slotName)
+					return slot;
+			}
+			return null;
+		};
+		Skeleton.prototype.findSlotIndex = function (slotName) {
+			if (slotName == null)
+				throw new Error("slotName cannot be null.");
+			var slots = this.slots;
+			for (var i = 0, n = slots.length; i < n; i++)
+				if (slots[i].data.name == slotName)
+					return i;
+			return -1;
+		};
+		Skeleton.prototype.setSkinByName = function (skinName) {
+			var skin = this.data.findSkin(skinName);
+			if (skin == null)
+				throw new Error("Skin not found: " + skinName);
+			this.setSkin(skin);
+		};
+		Skeleton.prototype.setSkin = function (newSkin) {
+			if (newSkin != null) {
+				if (this.skin != null)
+					newSkin.attachAll(this, this.skin);
+				else {
+					var slots = this.slots;
+					for (var i = 0, n = slots.length; i < n; i++) {
+						var slot = slots[i];
+						var name_1 = slot.data.attachmentName;
+						if (name_1 != null) {
+							var attachment = newSkin.getAttachment(i, name_1);
+							if (attachment != null)
+								slot.setAttachment(attachment);
 						}
 						}
-						else
-							throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
 					}
 					}
 				}
 				}
 			}
 			}
-			if (map.ik) {
-				for (var constraintName in map.ik) {
-					var constraintMap = map.ik[constraintName];
-					var constraint = skeletonData.findIkConstraint(constraintName);
-					var timeline = new spine.IkConstraintTimeline(constraintMap.length);
-					timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);
-					var frameIndex = 0;
-					for (var i = 0; i < constraintMap.length; i++) {
-						var valueMap = constraintMap[i];
-						timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1);
-						this.readCurve(valueMap, timeline, frameIndex);
-						frameIndex++;
-					}
-					timelines.push(timeline);
-					duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]);
-				}
+			this.skin = newSkin;
+		};
+		Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {
+			return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);
+		};
+		Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {
+			if (attachmentName == null)
+				throw new Error("attachmentName cannot be null.");
+			if (this.skin != null) {
+				var attachment = this.skin.getAttachment(slotIndex, attachmentName);
+				if (attachment != null)
+					return attachment;
 			}
 			}
-			if (map.transform) {
-				for (var constraintName in map.transform) {
-					var constraintMap = map.transform[constraintName];
-					var constraint = skeletonData.findTransformConstraint(constraintName);
-					var timeline = new spine.TransformConstraintTimeline(constraintMap.length);
-					timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);
-					var frameIndex = 0;
-					for (var i = 0; i < constraintMap.length; i++) {
-						var valueMap = constraintMap[i];
-						timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1));
-						this.readCurve(valueMap, timeline, frameIndex);
-						frameIndex++;
+			if (this.data.defaultSkin != null)
+				return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);
+			return null;
+		};
+		Skeleton.prototype.setAttachment = function (slotName, attachmentName) {
+			if (slotName == null)
+				throw new Error("slotName cannot be null.");
+			var slots = this.slots;
+			for (var i = 0, n = slots.length; i < n; i++) {
+				var slot = slots[i];
+				if (slot.data.name == slotName) {
+					var attachment = null;
+					if (attachmentName != null) {
+						attachment = this.getAttachment(i, attachmentName);
+						if (attachment == null)
+							throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName);
 					}
 					}
-					timelines.push(timeline);
-					duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]);
+					slot.setAttachment(attachment);
+					return;
 				}
 				}
 			}
 			}
-			if (map.paths) {
-				for (var constraintName in map.paths) {
-					var constraintMap = map.paths[constraintName];
-					var index = skeletonData.findPathConstraintIndex(constraintName);
-					if (index == -1)
-						throw new Error("Path constraint not found: " + constraintName);
-					var data = skeletonData.pathConstraints[index];
-					for (var timelineName in constraintMap) {
-						var timelineMap = constraintMap[timelineName];
-						if (timelineName === "position" || timelineName === "spacing") {
-							var timeline = null;
-							var timelineScale = 1;
-							if (timelineName === "spacing") {
-								timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length);
-								if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)
-									timelineScale = scale;
-							}
-							else {
-								timeline = new spine.PathConstraintPositionTimeline(timelineMap.length);
-								if (data.positionMode == spine.PositionMode.Fixed)
-									timelineScale = scale;
-							}
-							timeline.pathConstraintIndex = index;
-							var frameIndex = 0;
-							for (var i = 0; i < timelineMap.length; i++) {
-								var valueMap = timelineMap[i];
-								timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);
-								this.readCurve(valueMap, timeline, frameIndex);
-								frameIndex++;
-							}
-							timelines.push(timeline);
-							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);
-						}
-						else if (timelineName === "mix") {
-							var timeline = new spine.PathConstraintMixTimeline(timelineMap.length);
-							timeline.pathConstraintIndex = index;
-							var frameIndex = 0;
-							for (var i = 0; i < timelineMap.length; i++) {
-								var valueMap = timelineMap[i];
-								timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1));
-								this.readCurve(valueMap, timeline, frameIndex);
-								frameIndex++;
-							}
-							timelines.push(timeline);
-							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]);
-						}
-					}
-				}
+			throw new Error("Slot not found: " + slotName);
+		};
+		Skeleton.prototype.findIkConstraint = function (constraintName) {
+			if (constraintName == null)
+				throw new Error("constraintName cannot be null.");
+			var ikConstraints = this.ikConstraints;
+			for (var i = 0, n = ikConstraints.length; i < n; i++) {
+				var ikConstraint = ikConstraints[i];
+				if (ikConstraint.data.name == constraintName)
+					return ikConstraint;
 			}
 			}
-			if (map.deform) {
-				for (var deformName in map.deform) {
-					var deformMap = map.deform[deformName];
-					var skin = skeletonData.findSkin(deformName);
-					if (skin == null)
-						throw new Error("Skin not found: " + deformName);
-					for (var slotName in deformMap) {
-						var slotMap = deformMap[slotName];
-						var slotIndex = skeletonData.findSlotIndex(slotName);
-						if (slotIndex == -1)
-							throw new Error("Slot not found: " + slotMap.name);
-						for (var timelineName in slotMap) {
-							var timelineMap = slotMap[timelineName];
-							var attachment = skin.getAttachment(slotIndex, timelineName);
-							if (attachment == null)
-								throw new Error("Deform attachment not found: " + timelineMap.name);
-							var weighted = attachment.bones != null;
-							var vertices = attachment.vertices;
-							var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;
-							var timeline = new spine.DeformTimeline(timelineMap.length);
-							timeline.slotIndex = slotIndex;
-							timeline.attachment = attachment;
-							var frameIndex = 0;
-							for (var j = 0; j < timelineMap.length; j++) {
-								var valueMap = timelineMap[j];
-								var deform = void 0;
-								var verticesValue = this.getValue(valueMap, "vertices", null);
-								if (verticesValue == null)
-									deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;
-								else {
-									deform = spine.Utils.newFloatArray(deformLength);
-									var start = this.getValue(valueMap, "offset", 0);
-									spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);
-									if (scale != 1) {
-										for (var i = start, n = i + verticesValue.length; i < n; i++)
-											deform[i] *= scale;
-									}
-									if (!weighted) {
-										for (var i = 0; i < deformLength; i++)
-											deform[i] += vertices[i];
-									}
-								}
-								timeline.setFrame(frameIndex, valueMap.time, deform);
-								this.readCurve(valueMap, timeline, frameIndex);
-								frameIndex++;
-							}
-							timelines.push(timeline);
-							duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
-						}
+			return null;
+		};
+		Skeleton.prototype.findTransformConstraint = function (constraintName) {
+			if (constraintName == null)
+				throw new Error("constraintName cannot be null.");
+			var transformConstraints = this.transformConstraints;
+			for (var i = 0, n = transformConstraints.length; i < n; i++) {
+				var constraint = transformConstraints[i];
+				if (constraint.data.name == constraintName)
+					return constraint;
+			}
+			return null;
+		};
+		Skeleton.prototype.findPathConstraint = function (constraintName) {
+			if (constraintName == null)
+				throw new Error("constraintName cannot be null.");
+			var pathConstraints = this.pathConstraints;
+			for (var i = 0, n = pathConstraints.length; i < n; i++) {
+				var constraint = pathConstraints[i];
+				if (constraint.data.name == constraintName)
+					return constraint;
+			}
+			return null;
+		};
+		Skeleton.prototype.getBounds = function (offset, size, temp) {
+			if (offset == null)
+				throw new Error("offset cannot be null.");
+			if (size == null)
+				throw new Error("size cannot be null.");
+			var drawOrder = this.drawOrder;
+			var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;
+			for (var i = 0, n = drawOrder.length; i < n; i++) {
+				var slot = drawOrder[i];
+				var verticesLength = 0;
+				var vertices = null;
+				var attachment = slot.getAttachment();
+				if (attachment instanceof spine.RegionAttachment) {
+					verticesLength = 8;
+					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
+					attachment.computeWorldVertices(slot.bone, vertices, 0, 2);
+				}
+				else if (attachment instanceof spine.MeshAttachment) {
+					var mesh = attachment;
+					verticesLength = mesh.worldVerticesLength;
+					vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
+					mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
+				}
+				if (vertices != null) {
+					for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
+						var x = vertices[ii], y = vertices[ii + 1];
+						minX = Math.min(minX, x);
+						minY = Math.min(minY, y);
+						maxX = Math.max(maxX, x);
+						maxY = Math.max(maxY, y);
 					}
 					}
 				}
 				}
 			}
 			}
-			var drawOrderNode = map.drawOrder;
-			if (drawOrderNode == null)
-				drawOrderNode = map.draworder;
-			if (drawOrderNode != null) {
-				var timeline = new spine.DrawOrderTimeline(drawOrderNode.length);
-				var slotCount = skeletonData.slots.length;
-				var frameIndex = 0;
-				for (var j = 0; j < drawOrderNode.length; j++) {
-					var drawOrderMap = drawOrderNode[j];
-					var drawOrder = null;
-					var offsets = this.getValue(drawOrderMap, "offsets", null);
-					if (offsets != null) {
-						drawOrder = spine.Utils.newArray(slotCount, -1);
-						var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0);
-						var originalIndex = 0, unchangedIndex = 0;
-						for (var i = 0; i < offsets.length; i++) {
-							var offsetMap = offsets[i];
-							var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);
-							if (slotIndex == -1)
-								throw new Error("Slot not found: " + offsetMap.slot);
-							while (originalIndex != slotIndex)
-								unchanged[unchangedIndex++] = originalIndex++;
-							drawOrder[originalIndex + offsetMap.offset] = originalIndex++;
-						}
-						while (originalIndex < slotCount)
-							unchanged[unchangedIndex++] = originalIndex++;
-						for (var i = slotCount - 1; i >= 0; i--)
-							if (drawOrder[i] == -1)
-								drawOrder[i] = unchanged[--unchangedIndex];
+			offset.set(minX, minY);
+			size.set(maxX - minX, maxY - minY);
+		};
+		Skeleton.prototype.update = function (delta) {
+			this.time += delta;
+		};
+		return Skeleton;
+	}());
+	spine.Skeleton = Skeleton;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var SkeletonBounds = (function () {
+		function SkeletonBounds() {
+			this.minX = 0;
+			this.minY = 0;
+			this.maxX = 0;
+			this.maxY = 0;
+			this.boundingBoxes = new Array();
+			this.polygons = new Array();
+			this.polygonPool = new spine.Pool(function () {
+				return spine.Utils.newFloatArray(16);
+			});
+		}
+		SkeletonBounds.prototype.update = function (skeleton, updateAabb) {
+			if (skeleton == null)
+				throw new Error("skeleton cannot be null.");
+			var boundingBoxes = this.boundingBoxes;
+			var polygons = this.polygons;
+			var polygonPool = this.polygonPool;
+			var slots = skeleton.slots;
+			var slotCount = slots.length;
+			boundingBoxes.length = 0;
+			polygonPool.freeAll(polygons);
+			polygons.length = 0;
+			for (var i = 0; i < slotCount; i++) {
+				var slot = slots[i];
+				var attachment = slot.getAttachment();
+				if (attachment instanceof spine.BoundingBoxAttachment) {
+					var boundingBox = attachment;
+					boundingBoxes.push(boundingBox);
+					var polygon = polygonPool.obtain();
+					if (polygon.length != boundingBox.worldVerticesLength) {
+						polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength);
 					}
 					}
-					timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);
+					polygons.push(polygon);
+					boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);
 				}
 				}
-				timelines.push(timeline);
-				duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
 			}
 			}
-			if (map.events) {
-				var timeline = new spine.EventTimeline(map.events.length);
-				var frameIndex = 0;
-				for (var i = 0; i < map.events.length; i++) {
-					var eventMap = map.events[i];
-					var eventData = skeletonData.findEvent(eventMap.name);
-					if (eventData == null)
-						throw new Error("Event not found: " + eventMap.name);
-					var event_5 = new spine.Event(eventMap.time, eventData);
-					event_5.intValue = this.getValue(eventMap, "int", eventData.intValue);
-					event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue);
-					event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue);
-					timeline.setFrame(frameIndex++, event_5);
-				}
-				timelines.push(timeline);
-				duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
+			if (updateAabb) {
+				this.aabbCompute();
 			}
 			}
-			if (isNaN(duration)) {
-				throw new Error("Error while parsing animation, duration is NaN");
+			else {
+				this.minX = Number.POSITIVE_INFINITY;
+				this.minY = Number.POSITIVE_INFINITY;
+				this.maxX = Number.NEGATIVE_INFINITY;
+				this.maxY = Number.NEGATIVE_INFINITY;
 			}
 			}
-			skeletonData.animations.push(new spine.Animation(name, timelines, duration));
 		};
 		};
-		SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
-			if (!map.curve)
-				return;
-			if (map.curve === "stepped")
-				timeline.setStepped(frameIndex);
-			else if (Object.prototype.toString.call(map.curve) === '[object Array]') {
-				var curve = map.curve;
-				timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);
-			}
-		};
-		SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {
-			return map[prop] !== undefined ? map[prop] : defaultValue;
-		};
-		SkeletonJson.blendModeFromString = function (str) {
-			str = str.toLowerCase();
-			if (str == "normal")
-				return spine.BlendMode.Normal;
-			if (str == "additive")
-				return spine.BlendMode.Additive;
-			if (str == "multiply")
-				return spine.BlendMode.Multiply;
-			if (str == "screen")
-				return spine.BlendMode.Screen;
-			throw new Error("Unknown blend mode: " + str);
-		};
-		SkeletonJson.positionModeFromString = function (str) {
-			str = str.toLowerCase();
-			if (str == "fixed")
-				return spine.PositionMode.Fixed;
-			if (str == "percent")
-				return spine.PositionMode.Percent;
-			throw new Error("Unknown position mode: " + str);
-		};
-		SkeletonJson.spacingModeFromString = function (str) {
-			str = str.toLowerCase();
-			if (str == "length")
-				return spine.SpacingMode.Length;
-			if (str == "fixed")
-				return spine.SpacingMode.Fixed;
-			if (str == "percent")
-				return spine.SpacingMode.Percent;
-			throw new Error("Unknown position mode: " + str);
+		SkeletonBounds.prototype.aabbCompute = function () {
+			var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;
+			var polygons = this.polygons;
+			for (var i = 0, n = polygons.length; i < n; i++) {
+				var polygon = polygons[i];
+				var vertices = polygon;
+				for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {
+					var x = vertices[ii];
+					var y = vertices[ii + 1];
+					minX = Math.min(minX, x);
+					minY = Math.min(minY, y);
+					maxX = Math.max(maxX, x);
+					maxY = Math.max(maxY, y);
+				}
+			}
+			this.minX = minX;
+			this.minY = minY;
+			this.maxX = maxX;
+			this.maxY = maxY;
 		};
 		};
-		SkeletonJson.rotateModeFromString = function (str) {
-			str = str.toLowerCase();
-			if (str == "tangent")
-				return spine.RotateMode.Tangent;
-			if (str == "chain")
-				return spine.RotateMode.Chain;
-			if (str == "chainscale")
-				return spine.RotateMode.ChainScale;
-			throw new Error("Unknown rotate mode: " + str);
+		SkeletonBounds.prototype.aabbContainsPoint = function (x, y) {
+			return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;
 		};
 		};
-		SkeletonJson.transformModeFromString = function (str) {
-			str = str.toLowerCase();
-			if (str == "normal")
-				return spine.TransformMode.Normal;
-			if (str == "onlytranslation")
-				return spine.TransformMode.OnlyTranslation;
-			if (str == "norotationorreflection")
-				return spine.TransformMode.NoRotationOrReflection;
-			if (str == "noscale")
-				return spine.TransformMode.NoScale;
-			if (str == "noscaleorreflection")
-				return spine.TransformMode.NoScaleOrReflection;
-			throw new Error("Unknown transform mode: " + str);
+		SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {
+			var minX = this.minX;
+			var minY = this.minY;
+			var maxX = this.maxX;
+			var maxY = this.maxY;
+			if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))
+				return false;
+			var m = (y2 - y1) / (x2 - x1);
+			var y = m * (minX - x1) + y1;
+			if (y > minY && y < maxY)
+				return true;
+			y = m * (maxX - x1) + y1;
+			if (y > minY && y < maxY)
+				return true;
+			var x = (minY - y1) / m + x1;
+			if (x > minX && x < maxX)
+				return true;
+			x = (maxY - y1) / m + x1;
+			if (x > minX && x < maxX)
+				return true;
+			return false;
 		};
 		};
-		return SkeletonJson;
-	}());
-	spine.SkeletonJson = SkeletonJson;
-	var LinkedMesh = (function () {
-		function LinkedMesh(mesh, skin, slotIndex, parent) {
-			this.mesh = mesh;
-			this.skin = skin;
-			this.slotIndex = slotIndex;
-			this.parent = parent;
-		}
-		return LinkedMesh;
-	}());
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var Skin = (function () {
-		function Skin(name) {
-			this.attachments = new Array();
-			if (name == null)
-				throw new Error("name cannot be null.");
-			this.name = name;
-		}
-		Skin.prototype.addAttachment = function (slotIndex, name, attachment) {
-			if (attachment == null)
-				throw new Error("attachment cannot be null.");
-			var attachments = this.attachments;
-			if (slotIndex >= attachments.length)
-				attachments.length = slotIndex + 1;
-			if (!attachments[slotIndex])
-				attachments[slotIndex] = {};
-			attachments[slotIndex][name] = attachment;
+		SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) {
+			return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;
 		};
 		};
-		Skin.prototype.getAttachment = function (slotIndex, name) {
-			var dictionary = this.attachments[slotIndex];
-			return dictionary ? dictionary[name] : null;
+		SkeletonBounds.prototype.containsPoint = function (x, y) {
+			var polygons = this.polygons;
+			for (var i = 0, n = polygons.length; i < n; i++)
+				if (this.containsPointPolygon(polygons[i], x, y))
+					return this.boundingBoxes[i];
+			return null;
 		};
 		};
-		Skin.prototype.attachAll = function (skeleton, oldSkin) {
-			var slotIndex = 0;
-			for (var i = 0; i < skeleton.slots.length; i++) {
-				var slot = skeleton.slots[i];
-				var slotAttachment = slot.getAttachment();
-				if (slotAttachment && slotIndex < oldSkin.attachments.length) {
-					var dictionary = oldSkin.attachments[slotIndex];
-					for (var key in dictionary) {
-						var skinAttachment = dictionary[key];
-						if (slotAttachment == skinAttachment) {
-							var attachment = this.getAttachment(slotIndex, key);
-							if (attachment != null)
-								slot.setAttachment(attachment);
-							break;
-						}
-					}
+		SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) {
+			var vertices = polygon;
+			var nn = polygon.length;
+			var prevIndex = nn - 2;
+			var inside = false;
+			for (var ii = 0; ii < nn; ii += 2) {
+				var vertexY = vertices[ii + 1];
+				var prevY = vertices[prevIndex + 1];
+				if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {
+					var vertexX = vertices[ii];
+					if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)
+						inside = !inside;
 				}
 				}
-				slotIndex++;
+				prevIndex = ii;
 			}
 			}
+			return inside;
 		};
 		};
-		return Skin;
-	}());
-	spine.Skin = Skin;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var Slot = (function () {
-		function Slot(data, bone) {
-			this.attachmentVertices = new Array();
-			if (data == null)
-				throw new Error("data cannot be null.");
-			if (bone == null)
-				throw new Error("bone cannot be null.");
-			this.data = data;
-			this.bone = bone;
-			this.color = new spine.Color();
-			this.darkColor = data.darkColor == null ? null : new spine.Color();
-			this.setToSetupPose();
-		}
-		Slot.prototype.getAttachment = function () {
-			return this.attachment;
+		SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) {
+			var polygons = this.polygons;
+			for (var i = 0, n = polygons.length; i < n; i++)
+				if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))
+					return this.boundingBoxes[i];
+			return null;
 		};
 		};
-		Slot.prototype.setAttachment = function (attachment) {
-			if (this.attachment == attachment)
-				return;
-			this.attachment = attachment;
-			this.attachmentTime = this.bone.skeleton.time;
-			this.attachmentVertices.length = 0;
+		SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {
+			var vertices = polygon;
+			var nn = polygon.length;
+			var width12 = x1 - x2, height12 = y1 - y2;
+			var det1 = x1 * y2 - y1 * x2;
+			var x3 = vertices[nn - 2], y3 = vertices[nn - 1];
+			for (var ii = 0; ii < nn; ii += 2) {
+				var x4 = vertices[ii], y4 = vertices[ii + 1];
+				var det2 = x3 * y4 - y3 * x4;
+				var width34 = x3 - x4, height34 = y3 - y4;
+				var det3 = width12 * height34 - height12 * width34;
+				var x = (det1 * width34 - width12 * det2) / det3;
+				if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {
+					var y = (det1 * height34 - height12 * det2) / det3;
+					if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))
+						return true;
+				}
+				x3 = x4;
+				y3 = y4;
+			}
+			return false;
 		};
 		};
-		Slot.prototype.setAttachmentTime = function (time) {
-			this.attachmentTime = this.bone.skeleton.time - time;
+		SkeletonBounds.prototype.getPolygon = function (boundingBox) {
+			if (boundingBox == null)
+				throw new Error("boundingBox cannot be null.");
+			var index = this.boundingBoxes.indexOf(boundingBox);
+			return index == -1 ? null : this.polygons[index];
 		};
 		};
-		Slot.prototype.getAttachmentTime = function () {
-			return this.bone.skeleton.time - this.attachmentTime;
+		SkeletonBounds.prototype.getWidth = function () {
+			return this.maxX - this.minX;
 		};
 		};
-		Slot.prototype.setToSetupPose = function () {
-			this.color.setFromColor(this.data.color);
-			if (this.darkColor != null)
-				this.darkColor.setFromColor(this.data.darkColor);
-			if (this.data.attachmentName == null)
-				this.attachment = null;
-			else {
-				this.attachment = null;
-				this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));
-			}
+		SkeletonBounds.prototype.getHeight = function () {
+			return this.maxY - this.minY;
 		};
 		};
-		return Slot;
+		return SkeletonBounds;
 	}());
 	}());
-	spine.Slot = Slot;
+	spine.SkeletonBounds = SkeletonBounds;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var SlotData = (function () {
-		function SlotData(index, name, boneData) {
-			this.color = new spine.Color(1, 1, 1, 1);
-			if (index < 0)
-				throw new Error("index must be >= 0.");
-			if (name == null)
-				throw new Error("name cannot be null.");
-			if (boneData == null)
-				throw new Error("boneData cannot be null.");
-			this.index = index;
-			this.name = name;
-			this.boneData = boneData;
-		}
-		return SlotData;
-	}());
-	spine.SlotData = SlotData;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var Texture = (function () {
-		function Texture(image) {
-			this._image = image;
+	var SkeletonClipping = (function () {
+		function SkeletonClipping() {
+			this.triangulator = new spine.Triangulator();
+			this.clippingPolygon = new Array();
+			this.clipOutput = new Array();
+			this.clippedVertices = new Array();
+			this.clippedTriangles = new Array();
+			this.scratch = new Array();
 		}
 		}
-		Texture.prototype.getImage = function () {
-			return this._image;
-		};
-		Texture.filterFromString = function (text) {
-			switch (text.toLowerCase()) {
-				case "nearest": return TextureFilter.Nearest;
-				case "linear": return TextureFilter.Linear;
-				case "mipmap": return TextureFilter.MipMap;
-				case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest;
-				case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest;
-				case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear;
-				case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear;
-				default: throw new Error("Unknown texture filter " + text);
+		SkeletonClipping.prototype.clipStart = function (slot, clip) {
+			if (this.clipAttachment != null)
+				return 0;
+			this.clipAttachment = clip;
+			var n = clip.worldVerticesLength;
+			var vertices = spine.Utils.setArraySize(this.clippingPolygon, n);
+			clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);
+			var clippingPolygon = this.clippingPolygon;
+			SkeletonClipping.makeClockwise(clippingPolygon);
+			var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));
+			for (var i = 0, n_1 = clippingPolygons.length; i < n_1; i++) {
+				var polygon = clippingPolygons[i];
+				SkeletonClipping.makeClockwise(polygon);
+				polygon.push(polygon[0]);
+				polygon.push(polygon[1]);
 			}
 			}
+			return clippingPolygons.length;
 		};
 		};
-		Texture.wrapFromString = function (text) {
-			switch (text.toLowerCase()) {
-				case "mirroredtepeat": return TextureWrap.MirroredRepeat;
-				case "clamptoedge": return TextureWrap.ClampToEdge;
-				case "repeat": return TextureWrap.Repeat;
-				default: throw new Error("Unknown texture wrap " + text);
-			}
+		SkeletonClipping.prototype.clipEndWithSlot = function (slot) {
+			if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data)
+				this.clipEnd();
 		};
 		};
-		return Texture;
-	}());
-	spine.Texture = Texture;
-	var TextureFilter;
-	(function (TextureFilter) {
-		TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest";
-		TextureFilter[TextureFilter["Linear"] = 9729] = "Linear";
-		TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap";
-		TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest";
-		TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest";
-		TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear";
-		TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear";
-	})(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {}));
-	var TextureWrap;
-	(function (TextureWrap) {
-		TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat";
-		TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge";
-		TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat";
-	})(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {}));
-	var TextureRegion = (function () {
-		function TextureRegion() {
-			this.u = 0;
-			this.v = 0;
-			this.u2 = 0;
-			this.v2 = 0;
-			this.width = 0;
-			this.height = 0;
-			this.rotate = false;
-			this.offsetX = 0;
-			this.offsetY = 0;
-			this.originalWidth = 0;
-			this.originalHeight = 0;
-		}
-		return TextureRegion;
-	}());
-	spine.TextureRegion = TextureRegion;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var TextureAtlas = (function () {
-		function TextureAtlas(atlasText, textureLoader) {
-			this.pages = new Array();
-			this.regions = new Array();
-			this.load(atlasText, textureLoader);
-		}
-		TextureAtlas.prototype.load = function (atlasText, textureLoader) {
-			if (textureLoader == null)
-				throw new Error("textureLoader cannot be null.");
-			var reader = new TextureAtlasReader(atlasText);
-			var tuple = new Array(4);
-			var page = null;
-			while (true) {
-				var line = reader.readLine();
-				if (line == null)
-					break;
-				line = line.trim();
-				if (line.length == 0)
-					page = null;
-				else if (!page) {
-					page = new TextureAtlasPage();
-					page.name = line;
-					if (reader.readTuple(tuple) == 2) {
-						page.width = parseInt(tuple[0]);
-						page.height = parseInt(tuple[1]);
-						reader.readTuple(tuple);
-					}
-					reader.readTuple(tuple);
-					page.minFilter = spine.Texture.filterFromString(tuple[0]);
-					page.magFilter = spine.Texture.filterFromString(tuple[1]);
-					var direction = reader.readValue();
-					page.uWrap = spine.TextureWrap.ClampToEdge;
-					page.vWrap = spine.TextureWrap.ClampToEdge;
-					if (direction == "x")
-						page.uWrap = spine.TextureWrap.Repeat;
-					else if (direction == "y")
-						page.vWrap = spine.TextureWrap.Repeat;
-					else if (direction == "xy")
-						page.uWrap = page.vWrap = spine.TextureWrap.Repeat;
-					page.texture = textureLoader(line);
-					page.texture.setFilters(page.minFilter, page.magFilter);
-					page.texture.setWraps(page.uWrap, page.vWrap);
-					page.width = page.texture.getImage().width;
-					page.height = page.texture.getImage().height;
-					this.pages.push(page);
-				}
-				else {
-					var region = new TextureAtlasRegion();
-					region.name = line;
-					region.page = page;
-					region.rotate = reader.readValue() == "true";
-					reader.readTuple(tuple);
-					var x = parseInt(tuple[0]);
-					var y = parseInt(tuple[1]);
-					reader.readTuple(tuple);
-					var width = parseInt(tuple[0]);
-					var height = parseInt(tuple[1]);
-					region.u = x / page.width;
-					region.v = y / page.height;
-					if (region.rotate) {
-						region.u2 = (x + height) / page.width;
-						region.v2 = (y + width) / page.height;
+		SkeletonClipping.prototype.clipEnd = function () {
+			if (this.clipAttachment == null)
+				return;
+			this.clipAttachment = null;
+			this.clippingPolygons = null;
+			this.clippedVertices.length = 0;
+			this.clippedTriangles.length = 0;
+			this.clippingPolygon.length = 0;
+		};
+		SkeletonClipping.prototype.isClipping = function () {
+			return this.clipAttachment != null;
+		};
+		SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) {
+			var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
+			var clippedTriangles = this.clippedTriangles;
+			var polygons = this.clippingPolygons;
+			var polygonsCount = this.clippingPolygons.length;
+			var vertexSize = twoColor ? 12 : 8;
+			var index = 0;
+			clippedVertices.length = 0;
+			clippedTriangles.length = 0;
+			outer: for (var i = 0; i < trianglesLength; i += 3) {
+				var vertexOffset = triangles[i] << 1;
+				var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
+				var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];
+				vertexOffset = triangles[i + 1] << 1;
+				var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];
+				var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];
+				vertexOffset = triangles[i + 2] << 1;
+				var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];
+				var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];
+				for (var p = 0; p < polygonsCount; p++) {
+					var s = clippedVertices.length;
+					if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {
+						var clipOutputLength = clipOutput.length;
+						if (clipOutputLength == 0)
+							continue;
+						var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;
+						var d = 1 / (d0 * d2 + d1 * (y1 - y3));
+						var clipOutputCount = clipOutputLength >> 1;
+						var clipOutputItems = this.clipOutput;
+						var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);
+						for (var ii = 0; ii < clipOutputLength; ii += 2) {
+							var x = clipOutputItems[ii], y = clipOutputItems[ii + 1];
+							clippedVerticesItems[s] = x;
+							clippedVerticesItems[s + 1] = y;
+							clippedVerticesItems[s + 2] = light.r;
+							clippedVerticesItems[s + 3] = light.g;
+							clippedVerticesItems[s + 4] = light.b;
+							clippedVerticesItems[s + 5] = light.a;
+							var c0 = x - x3, c1 = y - y3;
+							var a = (d0 * c0 + d1 * c1) * d;
+							var b = (d4 * c0 + d2 * c1) * d;
+							var c = 1 - a - b;
+							clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;
+							clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;
+							if (twoColor) {
+								clippedVerticesItems[s + 8] = dark.r;
+								clippedVerticesItems[s + 8] = dark.g;
+								clippedVerticesItems[s + 10] = dark.b;
+								clippedVerticesItems[s + 11] = dark.a;
+							}
+							s += vertexSize;
+						}
+						s = clippedTriangles.length;
+						var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));
+						clipOutputCount--;
+						for (var ii = 1; ii < clipOutputCount; ii++) {
+							clippedTrianglesItems[s] = index;
+							clippedTrianglesItems[s + 1] = (index + ii);
+							clippedTrianglesItems[s + 2] = (index + ii + 1);
+							s += 3;
+						}
+						index += clipOutputCount + 1;
 					}
 					}
 					else {
 					else {
-						region.u2 = (x + width) / page.width;
-						region.v2 = (y + height) / page.height;
+						var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize);
+						clippedVerticesItems[s] = x1;
+						clippedVerticesItems[s + 1] = y1;
+						clippedVerticesItems[s + 2] = light.r;
+						clippedVerticesItems[s + 3] = light.g;
+						clippedVerticesItems[s + 4] = light.b;
+						clippedVerticesItems[s + 5] = light.a;
+						if (!twoColor) {
+							clippedVerticesItems[s + 6] = u1;
+							clippedVerticesItems[s + 7] = v1;
+							clippedVerticesItems[s + 8] = x2;
+							clippedVerticesItems[s + 9] = y2;
+							clippedVerticesItems[s + 10] = light.r;
+							clippedVerticesItems[s + 11] = light.g;
+							clippedVerticesItems[s + 12] = light.b;
+							clippedVerticesItems[s + 13] = light.a;
+							clippedVerticesItems[s + 14] = u2;
+							clippedVerticesItems[s + 15] = v2;
+							clippedVerticesItems[s + 16] = x3;
+							clippedVerticesItems[s + 17] = y3;
+							clippedVerticesItems[s + 18] = light.r;
+							clippedVerticesItems[s + 19] = light.g;
+							clippedVerticesItems[s + 20] = light.b;
+							clippedVerticesItems[s + 21] = light.a;
+							clippedVerticesItems[s + 22] = u3;
+							clippedVerticesItems[s + 23] = v3;
+						}
+						else {
+							clippedVerticesItems[s + 6] = u1;
+							clippedVerticesItems[s + 7] = v1;
+							clippedVerticesItems[s + 8] = dark.r;
+							clippedVerticesItems[s + 9] = dark.g;
+							clippedVerticesItems[s + 10] = dark.b;
+							clippedVerticesItems[s + 11] = dark.a;
+							clippedVerticesItems[s + 12] = x2;
+							clippedVerticesItems[s + 13] = y2;
+							clippedVerticesItems[s + 14] = light.r;
+							clippedVerticesItems[s + 15] = light.g;
+							clippedVerticesItems[s + 16] = light.b;
+							clippedVerticesItems[s + 17] = light.a;
+							clippedVerticesItems[s + 18] = u2;
+							clippedVerticesItems[s + 19] = v2;
+							clippedVerticesItems[s + 20] = dark.r;
+							clippedVerticesItems[s + 21] = dark.g;
+							clippedVerticesItems[s + 22] = dark.b;
+							clippedVerticesItems[s + 23] = dark.a;
+							clippedVerticesItems[s + 24] = x3;
+							clippedVerticesItems[s + 25] = y3;
+							clippedVerticesItems[s + 26] = light.r;
+							clippedVerticesItems[s + 27] = light.g;
+							clippedVerticesItems[s + 28] = light.b;
+							clippedVerticesItems[s + 29] = light.a;
+							clippedVerticesItems[s + 30] = u3;
+							clippedVerticesItems[s + 31] = v3;
+							clippedVerticesItems[s + 32] = dark.r;
+							clippedVerticesItems[s + 33] = dark.g;
+							clippedVerticesItems[s + 34] = dark.b;
+							clippedVerticesItems[s + 35] = dark.a;
+						}
+						s = clippedTriangles.length;
+						var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3);
+						clippedTrianglesItems[s] = index;
+						clippedTrianglesItems[s + 1] = (index + 1);
+						clippedTrianglesItems[s + 2] = (index + 2);
+						index += 3;
+						continue outer;
 					}
 					}
-					region.x = x;
-					region.y = y;
-					region.width = Math.abs(width);
-					region.height = Math.abs(height);
-					if (reader.readTuple(tuple) == 4) {
-						if (reader.readTuple(tuple) == 4) {
-							reader.readTuple(tuple);
+				}
+			}
+		};
+		SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) {
+			var originalOutput = output;
+			var clipped = false;
+			var input = null;
+			if (clippingArea.length % 4 >= 2) {
+				input = output;
+				output = this.scratch;
+			}
+			else
+				input = this.scratch;
+			input.length = 0;
+			input.push(x1);
+			input.push(y1);
+			input.push(x2);
+			input.push(y2);
+			input.push(x3);
+			input.push(y3);
+			input.push(x1);
+			input.push(y1);
+			output.length = 0;
+			var clippingVertices = clippingArea;
+			var clippingVerticesLast = clippingArea.length - 4;
+			for (var i = 0;; i += 2) {
+				var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];
+				var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3];
+				var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2;
+				var inputVertices = input;
+				var inputVerticesLength = input.length - 2, outputStart = output.length;
+				for (var ii = 0; ii < inputVerticesLength; ii += 2) {
+					var inputX = inputVertices[ii], inputY = inputVertices[ii + 1];
+					var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3];
+					var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;
+					if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {
+						if (side2) {
+							output.push(inputX2);
+							output.push(inputY2);
+							continue;
 						}
 						}
+						var c0 = inputY2 - inputY, c2 = inputX2 - inputX;
+						var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / (c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY));
+						output.push(edgeX + (edgeX2 - edgeX) * ua);
+						output.push(edgeY + (edgeY2 - edgeY) * ua);
 					}
 					}
-					region.originalWidth = parseInt(tuple[0]);
-					region.originalHeight = parseInt(tuple[1]);
-					reader.readTuple(tuple);
-					region.offsetX = parseInt(tuple[0]);
-					region.offsetY = parseInt(tuple[1]);
-					region.index = parseInt(reader.readValue());
-					region.texture = page.texture;
-					this.regions.push(region);
+					else if (side2) {
+						var c0 = inputY2 - inputY, c2 = inputX2 - inputX;
+						var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / (c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY));
+						output.push(edgeX + (edgeX2 - edgeX) * ua);
+						output.push(edgeY + (edgeY2 - edgeY) * ua);
+						output.push(inputX2);
+						output.push(inputY2);
+					}
+					clipped = true;
 				}
 				}
+				if (outputStart == output.length) {
+					originalOutput.length = 0;
+					return true;
+				}
+				output.push(output[0]);
+				output.push(output[1]);
+				if (i == clippingVerticesLast)
+					break;
+				var temp = output;
+				output = input;
+				output.length = 0;
+				input = temp;
+			}
+			if (originalOutput != output) {
+				originalOutput.length = 0;
+				for (var i = 0, n = output.length - 2; i < n; i++)
+					originalOutput[i] = output[i];
+			}
+			else
+				originalOutput.length = originalOutput.length - 2;
+			return clipped;
+		};
+		SkeletonClipping.makeClockwise = function (polygon) {
+			var vertices = polygon;
+			var verticeslength = polygon.length;
+			var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;
+			for (var i = 0, n = verticeslength - 3; i < n; i += 2) {
+				p1x = vertices[i];
+				p1y = vertices[i + 1];
+				p2x = vertices[i + 2];
+				p2y = vertices[i + 3];
+				area += p1x * p2y - p2x * p1y;
+			}
+			if (area < 0)
+				return;
+			for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {
+				var x = vertices[i], y = vertices[i + 1];
+				var other = lastX - i;
+				vertices[i] = vertices[other];
+				vertices[i + 1] = vertices[other + 1];
+				vertices[other] = x;
+				vertices[other + 1] = y;
 			}
 			}
 		};
 		};
-		TextureAtlas.prototype.findRegion = function (name) {
-			for (var i = 0; i < this.regions.length; i++) {
-				if (this.regions[i].name == name) {
-					return this.regions[i];
-				}
+		return SkeletonClipping;
+	}());
+	spine.SkeletonClipping = SkeletonClipping;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var SkeletonData = (function () {
+		function SkeletonData() {
+			this.bones = new Array();
+			this.slots = new Array();
+			this.skins = new Array();
+			this.events = new Array();
+			this.animations = new Array();
+			this.ikConstraints = new Array();
+			this.transformConstraints = new Array();
+			this.pathConstraints = new Array();
+			this.fps = 0;
+		}
+		SkeletonData.prototype.findBone = function (boneName) {
+			if (boneName == null)
+				throw new Error("boneName cannot be null.");
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++) {
+				var bone = bones[i];
+				if (bone.name == boneName)
+					return bone;
 			}
 			}
 			return null;
 			return null;
 		};
 		};
-		TextureAtlas.prototype.dispose = function () {
-			for (var i = 0; i < this.pages.length; i++) {
-				this.pages[i].texture.dispose();
+		SkeletonData.prototype.findBoneIndex = function (boneName) {
+			if (boneName == null)
+				throw new Error("boneName cannot be null.");
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++)
+				if (bones[i].name == boneName)
+					return i;
+			return -1;
+		};
+		SkeletonData.prototype.findSlot = function (slotName) {
+			if (slotName == null)
+				throw new Error("slotName cannot be null.");
+			var slots = this.slots;
+			for (var i = 0, n = slots.length; i < n; i++) {
+				var slot = slots[i];
+				if (slot.name == slotName)
+					return slot;
 			}
 			}
+			return null;
 		};
 		};
-		return TextureAtlas;
-	}());
-	spine.TextureAtlas = TextureAtlas;
-	var TextureAtlasReader = (function () {
-		function TextureAtlasReader(text) {
-			this.index = 0;
-			this.lines = text.split(/\r\n|\r|\n/);
-		}
-		TextureAtlasReader.prototype.readLine = function () {
-			if (this.index >= this.lines.length)
-				return null;
-			return this.lines[this.index++];
+		SkeletonData.prototype.findSlotIndex = function (slotName) {
+			if (slotName == null)
+				throw new Error("slotName cannot be null.");
+			var slots = this.slots;
+			for (var i = 0, n = slots.length; i < n; i++)
+				if (slots[i].name == slotName)
+					return i;
+			return -1;
 		};
 		};
-		TextureAtlasReader.prototype.readValue = function () {
-			var line = this.readLine();
-			var colon = line.indexOf(":");
-			if (colon == -1)
-				throw new Error("Invalid line: " + line);
-			return line.substring(colon + 1).trim();
+		SkeletonData.prototype.findSkin = function (skinName) {
+			if (skinName == null)
+				throw new Error("skinName cannot be null.");
+			var skins = this.skins;
+			for (var i = 0, n = skins.length; i < n; i++) {
+				var skin = skins[i];
+				if (skin.name == skinName)
+					return skin;
+			}
+			return null;
 		};
 		};
-		TextureAtlasReader.prototype.readTuple = function (tuple) {
-			var line = this.readLine();
-			var colon = line.indexOf(":");
-			if (colon == -1)
-				throw new Error("Invalid line: " + line);
-			var i = 0, lastMatch = colon + 1;
-			for (; i < 3; i++) {
-				var comma = line.indexOf(",", lastMatch);
-				if (comma == -1)
-					break;
-				tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();
-				lastMatch = comma + 1;
+		SkeletonData.prototype.findEvent = function (eventDataName) {
+			if (eventDataName == null)
+				throw new Error("eventDataName cannot be null.");
+			var events = this.events;
+			for (var i = 0, n = events.length; i < n; i++) {
+				var event_4 = events[i];
+				if (event_4.name == eventDataName)
+					return event_4;
 			}
 			}
-			tuple[i] = line.substring(lastMatch).trim();
-			return i + 1;
+			return null;
 		};
 		};
-		return TextureAtlasReader;
-	}());
-	var TextureAtlasPage = (function () {
-		function TextureAtlasPage() {
-		}
-		return TextureAtlasPage;
+		SkeletonData.prototype.findAnimation = function (animationName) {
+			if (animationName == null)
+				throw new Error("animationName cannot be null.");
+			var animations = this.animations;
+			for (var i = 0, n = animations.length; i < n; i++) {
+				var animation = animations[i];
+				if (animation.name == animationName)
+					return animation;
+			}
+			return null;
+		};
+		SkeletonData.prototype.findIkConstraint = function (constraintName) {
+			if (constraintName == null)
+				throw new Error("constraintName cannot be null.");
+			var ikConstraints = this.ikConstraints;
+			for (var i = 0, n = ikConstraints.length; i < n; i++) {
+				var constraint = ikConstraints[i];
+				if (constraint.name == constraintName)
+					return constraint;
+			}
+			return null;
+		};
+		SkeletonData.prototype.findTransformConstraint = function (constraintName) {
+			if (constraintName == null)
+				throw new Error("constraintName cannot be null.");
+			var transformConstraints = this.transformConstraints;
+			for (var i = 0, n = transformConstraints.length; i < n; i++) {
+				var constraint = transformConstraints[i];
+				if (constraint.name == constraintName)
+					return constraint;
+			}
+			return null;
+		};
+		SkeletonData.prototype.findPathConstraint = function (constraintName) {
+			if (constraintName == null)
+				throw new Error("constraintName cannot be null.");
+			var pathConstraints = this.pathConstraints;
+			for (var i = 0, n = pathConstraints.length; i < n; i++) {
+				var constraint = pathConstraints[i];
+				if (constraint.name == constraintName)
+					return constraint;
+			}
+			return null;
+		};
+		SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {
+			if (pathConstraintName == null)
+				throw new Error("pathConstraintName cannot be null.");
+			var pathConstraints = this.pathConstraints;
+			for (var i = 0, n = pathConstraints.length; i < n; i++)
+				if (pathConstraints[i].name == pathConstraintName)
+					return i;
+			return -1;
+		};
+		return SkeletonData;
 	}());
 	}());
-	spine.TextureAtlasPage = TextureAtlasPage;
-	var TextureAtlasRegion = (function (_super) {
-		__extends(TextureAtlasRegion, _super);
-		function TextureAtlasRegion() {
-			return _super !== null && _super.apply(this, arguments) || this;
-		}
-		return TextureAtlasRegion;
-	}(spine.TextureRegion));
-	spine.TextureAtlasRegion = TextureAtlasRegion;
+	spine.SkeletonData = SkeletonData;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var TransformConstraint = (function () {
-		function TransformConstraint(data, skeleton) {
-			this.rotateMix = 0;
-			this.translateMix = 0;
-			this.scaleMix = 0;
-			this.shearMix = 0;
-			this.temp = new spine.Vector2();
-			if (data == null)
-				throw new Error("data cannot be null.");
-			if (skeleton == null)
-				throw new Error("skeleton cannot be null.");
-			this.data = data;
-			this.rotateMix = data.rotateMix;
-			this.translateMix = data.translateMix;
-			this.scaleMix = data.scaleMix;
-			this.shearMix = data.shearMix;
-			this.bones = new Array();
-			for (var i = 0; i < data.bones.length; i++)
-				this.bones.push(skeleton.findBone(data.bones[i].name));
-			this.target = skeleton.findBone(data.target.name);
+	var SkeletonJson = (function () {
+		function SkeletonJson(attachmentLoader) {
+			this.scale = 1;
+			this.linkedMeshes = new Array();
+			this.attachmentLoader = attachmentLoader;
 		}
 		}
-		TransformConstraint.prototype.apply = function () {
-			this.update();
-		};
-		TransformConstraint.prototype.update = function () {
-			if (this.data.local) {
-				if (this.data.relative)
-					this.applyRelativeLocal();
-				else
-					this.applyAbsoluteLocal();
-			}
-			else {
-				if (this.data.relative)
-					this.applyRelativeWorld();
-				else
-					this.applyAbsoluteWorld();
-			}
-		};
-		TransformConstraint.prototype.applyAbsoluteWorld = function () {
-			var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;
-			var target = this.target;
-			var ta = target.a, tb = target.b, tc = target.c, td = target.d;
-			var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;
-			var offsetRotation = this.data.offsetRotation * degRadReflect;
-			var offsetShearY = this.data.offsetShearY * degRadReflect;
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++) {
-				var bone = bones[i];
-				var modified = false;
-				if (rotateMix != 0) {
-					var a = bone.a, b = bone.b, c = bone.c, d = bone.d;
-					var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;
-					if (r > spine.MathUtils.PI)
-						r -= spine.MathUtils.PI2;
-					else if (r < -spine.MathUtils.PI)
-						r += spine.MathUtils.PI2;
-					r *= rotateMix;
-					var cos = Math.cos(r), sin = Math.sin(r);
-					bone.a = cos * a - sin * c;
-					bone.b = cos * b - sin * d;
-					bone.c = sin * a + cos * c;
-					bone.d = sin * b + cos * d;
-					modified = true;
+		SkeletonJson.prototype.readSkeletonData = function (json) {
+			var scale = this.scale;
+			var skeletonData = new spine.SkeletonData();
+			var root = typeof (json) === "string" ? JSON.parse(json) : json;
+			var skeletonMap = root.skeleton;
+			if (skeletonMap != null) {
+				skeletonData.hash = skeletonMap.hash;
+				skeletonData.version = skeletonMap.spine;
+				skeletonData.width = skeletonMap.width;
+				skeletonData.height = skeletonMap.height;
+				skeletonData.fps = skeletonMap.fps;
+				skeletonData.imagesPath = skeletonMap.images;
+			}
+			if (root.bones) {
+				for (var i = 0; i < root.bones.length; i++) {
+					var boneMap = root.bones[i];
+					var parent_2 = null;
+					var parentName = this.getValue(boneMap, "parent", null);
+					if (parentName != null) {
+						parent_2 = skeletonData.findBone(parentName);
+						if (parent_2 == null)
+							throw new Error("Parent bone not found: " + parentName);
+					}
+					var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_2);
+					data.length = this.getValue(boneMap, "length", 0) * scale;
+					data.x = this.getValue(boneMap, "x", 0) * scale;
+					data.y = this.getValue(boneMap, "y", 0) * scale;
+					data.rotation = this.getValue(boneMap, "rotation", 0);
+					data.scaleX = this.getValue(boneMap, "scaleX", 1);
+					data.scaleY = this.getValue(boneMap, "scaleY", 1);
+					data.shearX = this.getValue(boneMap, "shearX", 0);
+					data.shearY = this.getValue(boneMap, "shearY", 0);
+					data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal"));
+					skeletonData.bones.push(data);
 				}
 				}
-				if (translateMix != 0) {
-					var temp = this.temp;
-					target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));
-					bone.worldX += (temp.x - bone.worldX) * translateMix;
-					bone.worldY += (temp.y - bone.worldY) * translateMix;
-					modified = true;
+			}
+			if (root.slots) {
+				for (var i = 0; i < root.slots.length; i++) {
+					var slotMap = root.slots[i];
+					var slotName = slotMap.name;
+					var boneName = slotMap.bone;
+					var boneData = skeletonData.findBone(boneName);
+					if (boneData == null)
+						throw new Error("Slot bone not found: " + boneName);
+					var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData);
+					var color = this.getValue(slotMap, "color", null);
+					if (color != null)
+						data.color.setFromString(color);
+					var dark = this.getValue(slotMap, "dark", null);
+					if (dark != null) {
+						data.darkColor = new spine.Color(1, 1, 1, 1);
+						data.darkColor.setFromString(dark);
+					}
+					data.attachmentName = this.getValue(slotMap, "attachment", null);
+					data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, "blend", "normal"));
+					skeletonData.slots.push(data);
 				}
 				}
-				if (scaleMix > 0) {
-					var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);
-					var ts = Math.sqrt(ta * ta + tc * tc);
-					if (s > 0.00001)
-						s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;
-					bone.a *= s;
-					bone.c *= s;
-					s = Math.sqrt(bone.b * bone.b + bone.d * bone.d);
-					ts = Math.sqrt(tb * tb + td * td);
-					if (s > 0.00001)
-						s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;
-					bone.b *= s;
-					bone.d *= s;
-					modified = true;
+			}
+			if (root.ik) {
+				for (var i = 0; i < root.ik.length; i++) {
+					var constraintMap = root.ik[i];
+					var data = new spine.IkConstraintData(constraintMap.name);
+					data.order = this.getValue(constraintMap, "order", 0);
+					for (var j = 0; j < constraintMap.bones.length; j++) {
+						var boneName = constraintMap.bones[j];
+						var bone = skeletonData.findBone(boneName);
+						if (bone == null)
+							throw new Error("IK bone not found: " + boneName);
+						data.bones.push(bone);
+					}
+					var targetName = constraintMap.target;
+					data.target = skeletonData.findBone(targetName);
+					if (data.target == null)
+						throw new Error("IK target bone not found: " + targetName);
+					data.bendDirection = this.getValue(constraintMap, "bendPositive", true) ? 1 : -1;
+					data.mix = this.getValue(constraintMap, "mix", 1);
+					skeletonData.ikConstraints.push(data);
 				}
 				}
-				if (shearMix > 0) {
-					var b = bone.b, d = bone.d;
-					var by = Math.atan2(d, b);
-					var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));
-					if (r > spine.MathUtils.PI)
-						r -= spine.MathUtils.PI2;
-					else if (r < -spine.MathUtils.PI)
-						r += spine.MathUtils.PI2;
-					r = by + (r + offsetShearY) * shearMix;
-					var s = Math.sqrt(b * b + d * d);
-					bone.b = Math.cos(r) * s;
-					bone.d = Math.sin(r) * s;
-					modified = true;
+			}
+			if (root.transform) {
+				for (var i = 0; i < root.transform.length; i++) {
+					var constraintMap = root.transform[i];
+					var data = new spine.TransformConstraintData(constraintMap.name);
+					data.order = this.getValue(constraintMap, "order", 0);
+					for (var j = 0; j < constraintMap.bones.length; j++) {
+						var boneName = constraintMap.bones[j];
+						var bone = skeletonData.findBone(boneName);
+						if (bone == null)
+							throw new Error("Transform constraint bone not found: " + boneName);
+						data.bones.push(bone);
+					}
+					var targetName = constraintMap.target;
+					data.target = skeletonData.findBone(targetName);
+					if (data.target == null)
+						throw new Error("Transform constraint target bone not found: " + targetName);
+					data.local = this.getValue(constraintMap, "local", false);
+					data.relative = this.getValue(constraintMap, "relative", false);
+					data.offsetRotation = this.getValue(constraintMap, "rotation", 0);
+					data.offsetX = this.getValue(constraintMap, "x", 0) * scale;
+					data.offsetY = this.getValue(constraintMap, "y", 0) * scale;
+					data.offsetScaleX = this.getValue(constraintMap, "scaleX", 0);
+					data.offsetScaleY = this.getValue(constraintMap, "scaleY", 0);
+					data.offsetShearY = this.getValue(constraintMap, "shearY", 0);
+					data.rotateMix = this.getValue(constraintMap, "rotateMix", 1);
+					data.translateMix = this.getValue(constraintMap, "translateMix", 1);
+					data.scaleMix = this.getValue(constraintMap, "scaleMix", 1);
+					data.shearMix = this.getValue(constraintMap, "shearMix", 1);
+					skeletonData.transformConstraints.push(data);
 				}
 				}
-				if (modified)
-					bone.appliedValid = false;
 			}
 			}
-		};
-		TransformConstraint.prototype.applyRelativeWorld = function () {
-			var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;
-			var target = this.target;
-			var ta = target.a, tb = target.b, tc = target.c, td = target.d;
-			var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;
-			var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++) {
-				var bone = bones[i];
-				var modified = false;
-				if (rotateMix != 0) {
-					var a = bone.a, b = bone.b, c = bone.c, d = bone.d;
-					var r = Math.atan2(tc, ta) + offsetRotation;
-					if (r > spine.MathUtils.PI)
-						r -= spine.MathUtils.PI2;
-					else if (r < -spine.MathUtils.PI)
-						r += spine.MathUtils.PI2;
-					r *= rotateMix;
-					var cos = Math.cos(r), sin = Math.sin(r);
-					bone.a = cos * a - sin * c;
-					bone.b = cos * b - sin * d;
-					bone.c = sin * a + cos * c;
-					bone.d = sin * b + cos * d;
-					modified = true;
+			if (root.path) {
+				for (var i = 0; i < root.path.length; i++) {
+					var constraintMap = root.path[i];
+					var data = new spine.PathConstraintData(constraintMap.name);
+					data.order = this.getValue(constraintMap, "order", 0);
+					for (var j = 0; j < constraintMap.bones.length; j++) {
+						var boneName = constraintMap.bones[j];
+						var bone = skeletonData.findBone(boneName);
+						if (bone == null)
+							throw new Error("Transform constraint bone not found: " + boneName);
+						data.bones.push(bone);
+					}
+					var targetName = constraintMap.target;
+					data.target = skeletonData.findSlot(targetName);
+					if (data.target == null)
+						throw new Error("Path target slot not found: " + targetName);
+					data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, "positionMode", "percent"));
+					data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, "spacingMode", "length"));
+					data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, "rotateMode", "tangent"));
+					data.offsetRotation = this.getValue(constraintMap, "rotation", 0);
+					data.position = this.getValue(constraintMap, "position", 0);
+					if (data.positionMode == spine.PositionMode.Fixed)
+						data.position *= scale;
+					data.spacing = this.getValue(constraintMap, "spacing", 0);
+					if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)
+						data.spacing *= scale;
+					data.rotateMix = this.getValue(constraintMap, "rotateMix", 1);
+					data.translateMix = this.getValue(constraintMap, "translateMix", 1);
+					skeletonData.pathConstraints.push(data);
 				}
 				}
-				if (translateMix != 0) {
-					var temp = this.temp;
-					target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));
-					bone.worldX += temp.x * translateMix;
-					bone.worldY += temp.y * translateMix;
-					modified = true;
+			}
+			if (root.skins) {
+				for (var skinName in root.skins) {
+					var skinMap = root.skins[skinName];
+					var skin = new spine.Skin(skinName);
+					for (var slotName in skinMap) {
+						var slotIndex = skeletonData.findSlotIndex(slotName);
+						if (slotIndex == -1)
+							throw new Error("Slot not found: " + slotName);
+						var slotMap = skinMap[slotName];
+						for (var entryName in slotMap) {
+							var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData);
+							if (attachment != null)
+								skin.addAttachment(slotIndex, entryName, attachment);
+						}
+					}
+					skeletonData.skins.push(skin);
+					if (skin.name == "default")
+						skeletonData.defaultSkin = skin;
 				}
 				}
-				if (scaleMix > 0) {
-					var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;
-					bone.a *= s;
-					bone.c *= s;
-					s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;
-					bone.b *= s;
-					bone.d *= s;
-					modified = true;
+			}
+			for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {
+				var linkedMesh = this.linkedMeshes[i];
+				var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);
+				if (skin == null)
+					throw new Error("Skin not found: " + linkedMesh.skin);
+				var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
+				if (parent_3 == null)
+					throw new Error("Parent mesh not found: " + linkedMesh.parent);
+				linkedMesh.mesh.setParentMesh(parent_3);
+				linkedMesh.mesh.updateUVs();
+			}
+			this.linkedMeshes.length = 0;
+			if (root.events) {
+				for (var eventName in root.events) {
+					var eventMap = root.events[eventName];
+					var data = new spine.EventData(eventName);
+					data.intValue = this.getValue(eventMap, "int", 0);
+					data.floatValue = this.getValue(eventMap, "float", 0);
+					data.stringValue = this.getValue(eventMap, "string", "");
+					skeletonData.events.push(data);
 				}
 				}
-				if (shearMix > 0) {
-					var r = Math.atan2(td, tb) - Math.atan2(tc, ta);
-					if (r > spine.MathUtils.PI)
-						r -= spine.MathUtils.PI2;
-					else if (r < -spine.MathUtils.PI)
-						r += spine.MathUtils.PI2;
-					var b = bone.b, d = bone.d;
-					r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix;
-					var s = Math.sqrt(b * b + d * d);
-					bone.b = Math.cos(r) * s;
-					bone.d = Math.sin(r) * s;
-					modified = true;
+			}
+			if (root.animations) {
+				for (var animationName in root.animations) {
+					var animationMap = root.animations[animationName];
+					this.readAnimation(animationMap, animationName, skeletonData);
 				}
 				}
-				if (modified)
-					bone.appliedValid = false;
 			}
 			}
+			return skeletonData;
 		};
 		};
-		TransformConstraint.prototype.applyAbsoluteLocal = function () {
-			var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;
-			var target = this.target;
-			if (!target.appliedValid)
-				target.updateAppliedTransform();
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++) {
-				var bone = bones[i];
-				if (!bone.appliedValid)
-					bone.updateAppliedTransform();
-				var rotation = bone.arotation;
-				if (rotateMix != 0) {
-					var r = target.arotation - rotation + this.data.offsetRotation;
-					r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;
-					rotation += r * rotateMix;
+		SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {
+			var scale = this.scale;
+			name = this.getValue(map, "name", name);
+			var type = this.getValue(map, "type", "region");
+			switch (type) {
+				case "region": {
+					var path = this.getValue(map, "path", name);
+					var region = this.attachmentLoader.newRegionAttachment(skin, name, path);
+					if (region == null)
+						return null;
+					region.path = path;
+					region.x = this.getValue(map, "x", 0) * scale;
+					region.y = this.getValue(map, "y", 0) * scale;
+					region.scaleX = this.getValue(map, "scaleX", 1);
+					region.scaleY = this.getValue(map, "scaleY", 1);
+					region.rotation = this.getValue(map, "rotation", 0);
+					region.width = map.width * scale;
+					region.height = map.height * scale;
+					var color = this.getValue(map, "color", null);
+					if (color != null)
+						region.color.setFromString(color);
+					region.updateOffset();
+					return region;
 				}
 				}
-				var x = bone.ax, y = bone.ay;
-				if (translateMix != 0) {
-					x += (target.ax - x + this.data.offsetX) * translateMix;
-					y += (target.ay - y + this.data.offsetY) * translateMix;
+				case "boundingbox": {
+					var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);
+					if (box == null)
+						return null;
+					this.readVertices(map, box, map.vertexCount << 1);
+					var color = this.getValue(map, "color", null);
+					if (color != null)
+						box.color.setFromString(color);
+					return box;
 				}
 				}
-				var scaleX = bone.ascaleX, scaleY = bone.ascaleY;
-				if (scaleMix > 0) {
-					if (scaleX > 0.00001)
-						scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;
-					if (scaleY > 0.00001)
-						scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;
+				case "mesh":
+				case "linkedmesh": {
+					var path = this.getValue(map, "path", name);
+					var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);
+					if (mesh == null)
+						return null;
+					mesh.path = path;
+					var color = this.getValue(map, "color", null);
+					if (color != null)
+						mesh.color.setFromString(color);
+					var parent_4 = this.getValue(map, "parent", null);
+					if (parent_4 != null) {
+						mesh.inheritDeform = this.getValue(map, "deform", true);
+						this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, "skin", null), slotIndex, parent_4));
+						return mesh;
+					}
+					var uvs = map.uvs;
+					this.readVertices(map, mesh, uvs.length);
+					mesh.triangles = map.triangles;
+					mesh.regionUVs = uvs;
+					mesh.updateUVs();
+					mesh.hullLength = this.getValue(map, "hull", 0) * 2;
+					return mesh;
 				}
 				}
-				var shearY = bone.ashearY;
-				if (shearMix > 0) {
-					var r = target.ashearY - shearY + this.data.offsetShearY;
-					r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;
-					bone.shearY += r * shearMix;
+				case "path": {
+					var path = this.attachmentLoader.newPathAttachment(skin, name);
+					if (path == null)
+						return null;
+					path.closed = this.getValue(map, "closed", false);
+					path.constantSpeed = this.getValue(map, "constantSpeed", true);
+					var vertexCount = map.vertexCount;
+					this.readVertices(map, path, vertexCount << 1);
+					var lengths = spine.Utils.newArray(vertexCount / 3, 0);
+					for (var i = 0; i < map.lengths.length; i++)
+						lengths[i] = map.lengths[i] * scale;
+					path.lengths = lengths;
+					var color = this.getValue(map, "color", null);
+					if (color != null)
+						path.color.setFromString(color);
+					return path;
 				}
 				}
-				bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
-			}
-		};
-		TransformConstraint.prototype.applyRelativeLocal = function () {
-			var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;
-			var target = this.target;
-			if (!target.appliedValid)
-				target.updateAppliedTransform();
-			var bones = this.bones;
-			for (var i = 0, n = bones.length; i < n; i++) {
-				var bone = bones[i];
-				if (!bone.appliedValid)
-					bone.updateAppliedTransform();
-				var rotation = bone.arotation;
-				if (rotateMix != 0)
-					rotation += (target.arotation + this.data.offsetRotation) * rotateMix;
-				var x = bone.ax, y = bone.ay;
-				if (translateMix != 0) {
-					x += (target.ax + this.data.offsetX) * translateMix;
-					y += (target.ay + this.data.offsetY) * translateMix;
+				case "point": {
+					var point = this.attachmentLoader.newPointAttachment(skin, name);
+					if (point == null)
+						return null;
+					point.x = this.getValue(map, "x", 0) * scale;
+					point.y = this.getValue(map, "y", 0) * scale;
+					point.rotation = this.getValue(map, "rotation", 0);
+					var color = this.getValue(map, "color", null);
+					if (color != null)
+						point.color.setFromString(color);
+					return point;
 				}
 				}
-				var scaleX = bone.ascaleX, scaleY = bone.ascaleY;
-				if (scaleMix > 0) {
-					if (scaleX > 0.00001)
-						scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;
-					if (scaleY > 0.00001)
-						scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;
+				case "clipping": {
+					var clip = this.attachmentLoader.newClippingAttachment(skin, name);
+					if (clip == null)
+						return null;
+					var end = this.getValue(map, "end", null);
+					if (end != null) {
+						var slot = skeletonData.findSlot(end);
+						if (slot == null)
+							throw new Error("Clipping end slot not found: " + end);
+						clip.endSlot = slot;
+					}
+					var vertexCount = map.vertexCount;
+					this.readVertices(map, clip, vertexCount << 1);
+					var color = this.getValue(map, "color", null);
+					if (color != null)
+						clip.color.setFromString(color);
+					return clip;
 				}
 				}
-				var shearY = bone.ashearY;
-				if (shearMix > 0)
-					shearY += (target.ashearY + this.data.offsetShearY) * shearMix;
-				bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
 			}
 			}
+			return null;
 		};
 		};
-		TransformConstraint.prototype.getOrder = function () {
-			return this.data.order;
-		};
-		return TransformConstraint;
-	}());
-	spine.TransformConstraint = TransformConstraint;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var TransformConstraintData = (function () {
-		function TransformConstraintData(name) {
-			this.order = 0;
-			this.bones = new Array();
-			this.rotateMix = 0;
-			this.translateMix = 0;
-			this.scaleMix = 0;
-			this.shearMix = 0;
-			this.offsetRotation = 0;
-			this.offsetX = 0;
-			this.offsetY = 0;
-			this.offsetScaleX = 0;
-			this.offsetScaleY = 0;
-			this.offsetShearY = 0;
-			this.relative = false;
-			this.local = false;
-			if (name == null)
-				throw new Error("name cannot be null.");
-			this.name = name;
-		}
-		return TransformConstraintData;
-	}());
-	spine.TransformConstraintData = TransformConstraintData;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var Triangulator = (function () {
-		function Triangulator() {
-			this.convexPolygons = new Array();
-			this.convexPolygonsIndices = new Array();
-			this.indicesArray = new Array();
-			this.isConcaveArray = new Array();
-			this.triangles = new Array();
-			this.polygonPool = new spine.Pool(function () {
-				return new Array();
-			});
-			this.polygonIndicesPool = new spine.Pool(function () {
-				return new Array();
-			});
-		}
-		Triangulator.prototype.triangulate = function (verticesArray) {
-			var vertices = verticesArray;
-			var vertexCount = verticesArray.length >> 1;
-			var indices = this.indicesArray;
-			indices.length = 0;
-			for (var i = 0; i < vertexCount; i++)
-				indices[i] = i;
-			var isConcave = this.isConcaveArray;
-			isConcave.length = 0;
-			for (var i = 0, n = vertexCount; i < n; ++i)
-				isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);
-			var triangles = this.triangles;
-			triangles.length = 0;
-			while (vertexCount > 3) {
-				var previous = vertexCount - 1, i = 0, next = 1;
-				while (true) {
-					outer: if (!isConcave[i]) {
-						var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;
-						var p1x = vertices[p1], p1y = vertices[p1 + 1];
-						var p2x = vertices[p2], p2y = vertices[p2 + 1];
-						var p3x = vertices[p3], p3y = vertices[p3 + 1];
-						for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {
-							if (!isConcave[ii])
-								continue;
-							var v = indices[ii] << 1;
-							var vx = vertices[v], vy = vertices[v + 1];
-							if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {
-								if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {
-									if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy))
-										break outer;
-								}
+		SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {
+			var scale = this.scale;
+			attachment.worldVerticesLength = verticesLength;
+			var vertices = map.vertices;
+			if (verticesLength == vertices.length) {
+				var scaledVertices = spine.Utils.toFloatArray(vertices);
+				if (scale != 1) {
+					for (var i = 0, n = vertices.length; i < n; i++)
+						scaledVertices[i] *= scale;
+				}
+				attachment.vertices = scaledVertices;
+				return;
+			}
+			var weights = new Array();
+			var bones = new Array();
+			for (var i = 0, n = vertices.length; i < n;) {
+				var boneCount = vertices[i++];
+				bones.push(boneCount);
+				for (var nn = i + boneCount * 4; i < nn; i += 4) {
+					bones.push(vertices[i]);
+					weights.push(vertices[i + 1] * scale);
+					weights.push(vertices[i + 2] * scale);
+					weights.push(vertices[i + 3]);
+				}
+			}
+			attachment.bones = bones;
+			attachment.vertices = spine.Utils.toFloatArray(weights);
+		};
+		SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {
+			var scale = this.scale;
+			var timelines = new Array();
+			var duration = 0;
+			if (map.slots) {
+				for (var slotName in map.slots) {
+					var slotMap = map.slots[slotName];
+					var slotIndex = skeletonData.findSlotIndex(slotName);
+					if (slotIndex == -1)
+						throw new Error("Slot not found: " + slotName);
+					for (var timelineName in slotMap) {
+						var timelineMap = slotMap[timelineName];
+						if (timelineName == "attachment") {
+							var timeline = new spine.AttachmentTimeline(timelineMap.length);
+							timeline.slotIndex = slotIndex;
+							var frameIndex = 0;
+							for (var i = 0; i < timelineMap.length; i++) {
+								var valueMap = timelineMap[i];
+								timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);
 							}
 							}
+							timelines.push(timeline);
+							duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
 						}
 						}
-						break;
-					}
-					if (next == 0) {
-						do {
-							if (!isConcave[i])
-								break;
-							i--;
-						} while (i > 0);
-						break;
+						else if (timelineName == "color") {
+							var timeline = new spine.ColorTimeline(timelineMap.length);
+							timeline.slotIndex = slotIndex;
+							var frameIndex = 0;
+							for (var i = 0; i < timelineMap.length; i++) {
+								var valueMap = timelineMap[i];
+								var color = new spine.Color();
+								color.setFromString(valueMap.color);
+								timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);
+								this.readCurve(valueMap, timeline, frameIndex);
+								frameIndex++;
+							}
+							timelines.push(timeline);
+							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]);
+						}
+						else if (timelineName == "twoColor") {
+							var timeline = new spine.TwoColorTimeline(timelineMap.length);
+							timeline.slotIndex = slotIndex;
+							var frameIndex = 0;
+							for (var i = 0; i < timelineMap.length; i++) {
+								var valueMap = timelineMap[i];
+								var light = new spine.Color();
+								var dark = new spine.Color();
+								light.setFromString(valueMap.light);
+								dark.setFromString(valueMap.dark);
+								timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);
+								this.readCurve(valueMap, timeline, frameIndex);
+								frameIndex++;
+							}
+							timelines.push(timeline);
+							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]);
+						}
+						else
+							throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")");
 					}
 					}
-					previous = i;
-					i = next;
-					next = (next + 1) % vertexCount;
 				}
 				}
-				triangles.push(indices[(vertexCount + i - 1) % vertexCount]);
-				triangles.push(indices[i]);
-				triangles.push(indices[(i + 1) % vertexCount]);
-				indices.splice(i, 1);
-				isConcave.splice(i, 1);
-				vertexCount--;
-				var previousIndex = (vertexCount + i - 1) % vertexCount;
-				var nextIndex = i == vertexCount ? 0 : i;
-				isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);
-				isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);
 			}
 			}
-			if (vertexCount == 3) {
-				triangles.push(indices[2]);
-				triangles.push(indices[0]);
-				triangles.push(indices[1]);
+			if (map.bones) {
+				for (var boneName in map.bones) {
+					var boneMap = map.bones[boneName];
+					var boneIndex = skeletonData.findBoneIndex(boneName);
+					if (boneIndex == -1)
+						throw new Error("Bone not found: " + boneName);
+					for (var timelineName in boneMap) {
+						var timelineMap = boneMap[timelineName];
+						if (timelineName === "rotate") {
+							var timeline = new spine.RotateTimeline(timelineMap.length);
+							timeline.boneIndex = boneIndex;
+							var frameIndex = 0;
+							for (var i = 0; i < timelineMap.length; i++) {
+								var valueMap = timelineMap[i];
+								timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);
+								this.readCurve(valueMap, timeline, frameIndex);
+								frameIndex++;
+							}
+							timelines.push(timeline);
+							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]);
+						}
+						else if (timelineName === "translate" || timelineName === "scale" || timelineName === "shear") {
+							var timeline = null;
+							var timelineScale = 1;
+							if (timelineName === "scale")
+								timeline = new spine.ScaleTimeline(timelineMap.length);
+							else if (timelineName === "shear")
+								timeline = new spine.ShearTimeline(timelineMap.length);
+							else {
+								timeline = new spine.TranslateTimeline(timelineMap.length);
+								timelineScale = scale;
+							}
+							timeline.boneIndex = boneIndex;
+							var frameIndex = 0;
+							for (var i = 0; i < timelineMap.length; i++) {
+								var valueMap = timelineMap[i];
+								var x = this.getValue(valueMap, "x", 0), y = this.getValue(valueMap, "y", 0);
+								timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);
+								this.readCurve(valueMap, timeline, frameIndex);
+								frameIndex++;
+							}
+							timelines.push(timeline);
+							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]);
+						}
+						else
+							throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
+					}
+				}
 			}
 			}
-			return triangles;
-		};
-		Triangulator.prototype.decompose = function (verticesArray, triangles) {
-			var vertices = verticesArray;
-			var convexPolygons = this.convexPolygons;
-			this.polygonPool.freeAll(convexPolygons);
-			convexPolygons.length = 0;
-			var convexPolygonsIndices = this.convexPolygonsIndices;
-			this.polygonIndicesPool.freeAll(convexPolygonsIndices);
-			convexPolygonsIndices.length = 0;
-			var polygonIndices = this.polygonIndicesPool.obtain();
-			polygonIndices.length = 0;
-			var polygon = this.polygonPool.obtain();
-			polygon.length = 0;
-			var fanBaseIndex = -1, lastWinding = 0;
-			for (var i = 0, n = triangles.length; i < n; i += 3) {
-				var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;
-				var x1 = vertices[t1], y1 = vertices[t1 + 1];
-				var x2 = vertices[t2], y2 = vertices[t2 + 1];
-				var x3 = vertices[t3], y3 = vertices[t3 + 1];
-				var merged = false;
-				if (fanBaseIndex == t1) {
-					var o = polygon.length - 4;
-					var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);
-					var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);
-					if (winding1 == lastWinding && winding2 == lastWinding) {
-						polygon.push(x3);
-						polygon.push(y3);
-						polygonIndices.push(t3);
-						merged = true;
+			if (map.ik) {
+				for (var constraintName in map.ik) {
+					var constraintMap = map.ik[constraintName];
+					var constraint = skeletonData.findIkConstraint(constraintName);
+					var timeline = new spine.IkConstraintTimeline(constraintMap.length);
+					timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);
+					var frameIndex = 0;
+					for (var i = 0; i < constraintMap.length; i++) {
+						var valueMap = constraintMap[i];
+						timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "mix", 1), this.getValue(valueMap, "bendPositive", true) ? 1 : -1);
+						this.readCurve(valueMap, timeline, frameIndex);
+						frameIndex++;
 					}
 					}
+					timelines.push(timeline);
+					duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]);
 				}
 				}
-				if (!merged) {
-					if (polygon.length > 0) {
-						convexPolygons.push(polygon);
-						convexPolygonsIndices.push(polygonIndices);
+			}
+			if (map.transform) {
+				for (var constraintName in map.transform) {
+					var constraintMap = map.transform[constraintName];
+					var constraint = skeletonData.findTransformConstraint(constraintName);
+					var timeline = new spine.TransformConstraintTimeline(constraintMap.length);
+					timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);
+					var frameIndex = 0;
+					for (var i = 0; i < constraintMap.length; i++) {
+						var valueMap = constraintMap[i];
+						timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1), this.getValue(valueMap, "scaleMix", 1), this.getValue(valueMap, "shearMix", 1));
+						this.readCurve(valueMap, timeline, frameIndex);
+						frameIndex++;
 					}
 					}
-					else {
-						this.polygonPool.free(polygon);
-						this.polygonIndicesPool.free(polygonIndices);
+					timelines.push(timeline);
+					duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]);
+				}
+			}
+			if (map.paths) {
+				for (var constraintName in map.paths) {
+					var constraintMap = map.paths[constraintName];
+					var index = skeletonData.findPathConstraintIndex(constraintName);
+					if (index == -1)
+						throw new Error("Path constraint not found: " + constraintName);
+					var data = skeletonData.pathConstraints[index];
+					for (var timelineName in constraintMap) {
+						var timelineMap = constraintMap[timelineName];
+						if (timelineName === "position" || timelineName === "spacing") {
+							var timeline = null;
+							var timelineScale = 1;
+							if (timelineName === "spacing") {
+								timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length);
+								if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)
+									timelineScale = scale;
+							}
+							else {
+								timeline = new spine.PathConstraintPositionTimeline(timelineMap.length);
+								if (data.positionMode == spine.PositionMode.Fixed)
+									timelineScale = scale;
+							}
+							timeline.pathConstraintIndex = index;
+							var frameIndex = 0;
+							for (var i = 0; i < timelineMap.length; i++) {
+								var valueMap = timelineMap[i];
+								timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);
+								this.readCurve(valueMap, timeline, frameIndex);
+								frameIndex++;
+							}
+							timelines.push(timeline);
+							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);
+						}
+						else if (timelineName === "mix") {
+							var timeline = new spine.PathConstraintMixTimeline(timelineMap.length);
+							timeline.pathConstraintIndex = index;
+							var frameIndex = 0;
+							for (var i = 0; i < timelineMap.length; i++) {
+								var valueMap = timelineMap[i];
+								timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, "rotateMix", 1), this.getValue(valueMap, "translateMix", 1));
+								this.readCurve(valueMap, timeline, frameIndex);
+								frameIndex++;
+							}
+							timelines.push(timeline);
+							duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]);
+						}
 					}
 					}
-					polygon = this.polygonPool.obtain();
-					polygon.length = 0;
-					polygon.push(x1);
-					polygon.push(y1);
-					polygon.push(x2);
-					polygon.push(y2);
-					polygon.push(x3);
-					polygon.push(y3);
-					polygonIndices = this.polygonIndicesPool.obtain();
-					polygonIndices.length = 0;
-					polygonIndices.push(t1);
-					polygonIndices.push(t2);
-					polygonIndices.push(t3);
-					lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);
-					fanBaseIndex = t1;
 				}
 				}
 			}
 			}
-			if (polygon.length > 0) {
-				convexPolygons.push(polygon);
-				convexPolygonsIndices.push(polygonIndices);
+			if (map.deform) {
+				for (var deformName in map.deform) {
+					var deformMap = map.deform[deformName];
+					var skin = skeletonData.findSkin(deformName);
+					if (skin == null)
+						throw new Error("Skin not found: " + deformName);
+					for (var slotName in deformMap) {
+						var slotMap = deformMap[slotName];
+						var slotIndex = skeletonData.findSlotIndex(slotName);
+						if (slotIndex == -1)
+							throw new Error("Slot not found: " + slotMap.name);
+						for (var timelineName in slotMap) {
+							var timelineMap = slotMap[timelineName];
+							var attachment = skin.getAttachment(slotIndex, timelineName);
+							if (attachment == null)
+								throw new Error("Deform attachment not found: " + timelineMap.name);
+							var weighted = attachment.bones != null;
+							var vertices = attachment.vertices;
+							var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;
+							var timeline = new spine.DeformTimeline(timelineMap.length);
+							timeline.slotIndex = slotIndex;
+							timeline.attachment = attachment;
+							var frameIndex = 0;
+							for (var j = 0; j < timelineMap.length; j++) {
+								var valueMap = timelineMap[j];
+								var deform = void 0;
+								var verticesValue = this.getValue(valueMap, "vertices", null);
+								if (verticesValue == null)
+									deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;
+								else {
+									deform = spine.Utils.newFloatArray(deformLength);
+									var start = this.getValue(valueMap, "offset", 0);
+									spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);
+									if (scale != 1) {
+										for (var i = start, n = i + verticesValue.length; i < n; i++)
+											deform[i] *= scale;
+									}
+									if (!weighted) {
+										for (var i = 0; i < deformLength; i++)
+											deform[i] += vertices[i];
+									}
+								}
+								timeline.setFrame(frameIndex, valueMap.time, deform);
+								this.readCurve(valueMap, timeline, frameIndex);
+								frameIndex++;
+							}
+							timelines.push(timeline);
+							duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
+						}
+					}
+				}
 			}
 			}
-			for (var i = 0, n = convexPolygons.length; i < n; i++) {
-				polygonIndices = convexPolygonsIndices[i];
-				if (polygonIndices.length == 0)
-					continue;
-				var firstIndex = polygonIndices[0];
-				var lastIndex = polygonIndices[polygonIndices.length - 1];
-				polygon = convexPolygons[i];
-				var o = polygon.length - 4;
-				var prevPrevX = polygon[o], prevPrevY = polygon[o + 1];
-				var prevX = polygon[o + 2], prevY = polygon[o + 3];
-				var firstX = polygon[0], firstY = polygon[1];
-				var secondX = polygon[2], secondY = polygon[3];
-				var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);
-				for (var ii = 0; ii < n; ii++) {
-					if (ii == i)
-						continue;
-					var otherIndices = convexPolygonsIndices[ii];
-					if (otherIndices.length != 3)
-						continue;
-					var otherFirstIndex = otherIndices[0];
-					var otherSecondIndex = otherIndices[1];
-					var otherLastIndex = otherIndices[2];
-					var otherPoly = convexPolygons[ii];
-					var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];
-					if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex)
-						continue;
-					var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);
-					var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);
-					if (winding1 == winding && winding2 == winding) {
-						otherPoly.length = 0;
-						otherIndices.length = 0;
-						polygon.push(x3);
-						polygon.push(y3);
-						polygonIndices.push(otherLastIndex);
-						prevPrevX = prevX;
-						prevPrevY = prevY;
-						prevX = x3;
-						prevY = y3;
-						ii = 0;
+			var drawOrderNode = map.drawOrder;
+			if (drawOrderNode == null)
+				drawOrderNode = map.draworder;
+			if (drawOrderNode != null) {
+				var timeline = new spine.DrawOrderTimeline(drawOrderNode.length);
+				var slotCount = skeletonData.slots.length;
+				var frameIndex = 0;
+				for (var j = 0; j < drawOrderNode.length; j++) {
+					var drawOrderMap = drawOrderNode[j];
+					var drawOrder = null;
+					var offsets = this.getValue(drawOrderMap, "offsets", null);
+					if (offsets != null) {
+						drawOrder = spine.Utils.newArray(slotCount, -1);
+						var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0);
+						var originalIndex = 0, unchangedIndex = 0;
+						for (var i = 0; i < offsets.length; i++) {
+							var offsetMap = offsets[i];
+							var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);
+							if (slotIndex == -1)
+								throw new Error("Slot not found: " + offsetMap.slot);
+							while (originalIndex != slotIndex)
+								unchanged[unchangedIndex++] = originalIndex++;
+							drawOrder[originalIndex + offsetMap.offset] = originalIndex++;
+						}
+						while (originalIndex < slotCount)
+							unchanged[unchangedIndex++] = originalIndex++;
+						for (var i = slotCount - 1; i >= 0; i--)
+							if (drawOrder[i] == -1)
+								drawOrder[i] = unchanged[--unchangedIndex];
 					}
 					}
+					timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);
 				}
 				}
+				timelines.push(timeline);
+				duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
 			}
 			}
-			for (var i = convexPolygons.length - 1; i >= 0; i--) {
-				polygon = convexPolygons[i];
-				if (polygon.length == 0) {
-					convexPolygons.splice(i, 1);
-					this.polygonPool.free(polygon);
-					polygonIndices = convexPolygonsIndices[i];
-					convexPolygonsIndices.splice(i, 1);
-					this.polygonIndicesPool.free(polygonIndices);
+			if (map.events) {
+				var timeline = new spine.EventTimeline(map.events.length);
+				var frameIndex = 0;
+				for (var i = 0; i < map.events.length; i++) {
+					var eventMap = map.events[i];
+					var eventData = skeletonData.findEvent(eventMap.name);
+					if (eventData == null)
+						throw new Error("Event not found: " + eventMap.name);
+					var event_5 = new spine.Event(eventMap.time, eventData);
+					event_5.intValue = this.getValue(eventMap, "int", eventData.intValue);
+					event_5.floatValue = this.getValue(eventMap, "float", eventData.floatValue);
+					event_5.stringValue = this.getValue(eventMap, "string", eventData.stringValue);
+					timeline.setFrame(frameIndex++, event_5);
 				}
 				}
+				timelines.push(timeline);
+				duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
 			}
 			}
-			return convexPolygons;
+			if (isNaN(duration)) {
+				throw new Error("Error while parsing animation, duration is NaN");
+			}
+			skeletonData.animations.push(new spine.Animation(name, timelines, duration));
 		};
 		};
-		Triangulator.isConcave = function (index, vertexCount, vertices, indices) {
-			var previous = indices[(vertexCount + index - 1) % vertexCount] << 1;
-			var current = indices[index] << 1;
-			var next = indices[(index + 1) % vertexCount] << 1;
-			return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);
+		SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
+			if (!map.curve)
+				return;
+			if (map.curve === "stepped")
+				timeline.setStepped(frameIndex);
+			else if (Object.prototype.toString.call(map.curve) === '[object Array]') {
+				var curve = map.curve;
+				timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);
+			}
 		};
 		};
-		Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) {
-			return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;
+		SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {
+			return map[prop] !== undefined ? map[prop] : defaultValue;
 		};
 		};
-		Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) {
-			var px = p2x - p1x, py = p2y - p1y;
-			return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;
+		SkeletonJson.blendModeFromString = function (str) {
+			str = str.toLowerCase();
+			if (str == "normal")
+				return spine.BlendMode.Normal;
+			if (str == "additive")
+				return spine.BlendMode.Additive;
+			if (str == "multiply")
+				return spine.BlendMode.Multiply;
+			if (str == "screen")
+				return spine.BlendMode.Screen;
+			throw new Error("Unknown blend mode: " + str);
 		};
 		};
-		return Triangulator;
+		SkeletonJson.positionModeFromString = function (str) {
+			str = str.toLowerCase();
+			if (str == "fixed")
+				return spine.PositionMode.Fixed;
+			if (str == "percent")
+				return spine.PositionMode.Percent;
+			throw new Error("Unknown position mode: " + str);
+		};
+		SkeletonJson.spacingModeFromString = function (str) {
+			str = str.toLowerCase();
+			if (str == "length")
+				return spine.SpacingMode.Length;
+			if (str == "fixed")
+				return spine.SpacingMode.Fixed;
+			if (str == "percent")
+				return spine.SpacingMode.Percent;
+			throw new Error("Unknown position mode: " + str);
+		};
+		SkeletonJson.rotateModeFromString = function (str) {
+			str = str.toLowerCase();
+			if (str == "tangent")
+				return spine.RotateMode.Tangent;
+			if (str == "chain")
+				return spine.RotateMode.Chain;
+			if (str == "chainscale")
+				return spine.RotateMode.ChainScale;
+			throw new Error("Unknown rotate mode: " + str);
+		};
+		SkeletonJson.transformModeFromString = function (str) {
+			str = str.toLowerCase();
+			if (str == "normal")
+				return spine.TransformMode.Normal;
+			if (str == "onlytranslation")
+				return spine.TransformMode.OnlyTranslation;
+			if (str == "norotationorreflection")
+				return spine.TransformMode.NoRotationOrReflection;
+			if (str == "noscale")
+				return spine.TransformMode.NoScale;
+			if (str == "noscaleorreflection")
+				return spine.TransformMode.NoScaleOrReflection;
+			throw new Error("Unknown transform mode: " + str);
+		};
+		return SkeletonJson;
+	}());
+	spine.SkeletonJson = SkeletonJson;
+	var LinkedMesh = (function () {
+		function LinkedMesh(mesh, skin, slotIndex, parent) {
+			this.mesh = mesh;
+			this.skin = skin;
+			this.slotIndex = slotIndex;
+			this.parent = parent;
+		}
+		return LinkedMesh;
 	}());
 	}());
-	spine.Triangulator = Triangulator;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var IntSet = (function () {
-		function IntSet() {
-			this.array = new Array();
+	var Skin = (function () {
+		function Skin(name) {
+			this.attachments = new Array();
+			if (name == null)
+				throw new Error("name cannot be null.");
+			this.name = name;
 		}
 		}
-		IntSet.prototype.add = function (value) {
-			var contains = this.contains(value);
-			this.array[value | 0] = value | 0;
-			return !contains;
-		};
-		IntSet.prototype.contains = function (value) {
-			return this.array[value | 0] != undefined;
+		Skin.prototype.addAttachment = function (slotIndex, name, attachment) {
+			if (attachment == null)
+				throw new Error("attachment cannot be null.");
+			var attachments = this.attachments;
+			if (slotIndex >= attachments.length)
+				attachments.length = slotIndex + 1;
+			if (!attachments[slotIndex])
+				attachments[slotIndex] = {};
+			attachments[slotIndex][name] = attachment;
 		};
 		};
-		IntSet.prototype.remove = function (value) {
-			this.array[value | 0] = undefined;
+		Skin.prototype.getAttachment = function (slotIndex, name) {
+			var dictionary = this.attachments[slotIndex];
+			return dictionary ? dictionary[name] : null;
 		};
 		};
-		IntSet.prototype.clear = function () {
-			this.array.length = 0;
+		Skin.prototype.attachAll = function (skeleton, oldSkin) {
+			var slotIndex = 0;
+			for (var i = 0; i < skeleton.slots.length; i++) {
+				var slot = skeleton.slots[i];
+				var slotAttachment = slot.getAttachment();
+				if (slotAttachment && slotIndex < oldSkin.attachments.length) {
+					var dictionary = oldSkin.attachments[slotIndex];
+					for (var key in dictionary) {
+						var skinAttachment = dictionary[key];
+						if (slotAttachment == skinAttachment) {
+							var attachment = this.getAttachment(slotIndex, key);
+							if (attachment != null)
+								slot.setAttachment(attachment);
+							break;
+						}
+					}
+				}
+				slotIndex++;
+			}
 		};
 		};
-		return IntSet;
+		return Skin;
 	}());
 	}());
-	spine.IntSet = IntSet;
-	var Color = (function () {
-		function Color(r, g, b, a) {
-			if (r === void 0) { r = 0; }
-			if (g === void 0) { g = 0; }
-			if (b === void 0) { b = 0; }
-			if (a === void 0) { a = 0; }
-			this.r = r;
-			this.g = g;
-			this.b = b;
-			this.a = a;
+	spine.Skin = Skin;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var Slot = (function () {
+		function Slot(data, bone) {
+			this.attachmentVertices = new Array();
+			if (data == null)
+				throw new Error("data cannot be null.");
+			if (bone == null)
+				throw new Error("bone cannot be null.");
+			this.data = data;
+			this.bone = bone;
+			this.color = new spine.Color();
+			this.darkColor = data.darkColor == null ? null : new spine.Color();
+			this.setToSetupPose();
 		}
 		}
-		Color.prototype.set = function (r, g, b, a) {
-			this.r = r;
-			this.g = g;
-			this.b = b;
-			this.a = a;
-			this.clamp();
-			return this;
+		Slot.prototype.getAttachment = function () {
+			return this.attachment;
 		};
 		};
-		Color.prototype.setFromColor = function (c) {
-			this.r = c.r;
-			this.g = c.g;
-			this.b = c.b;
-			this.a = c.a;
-			return this;
+		Slot.prototype.setAttachment = function (attachment) {
+			if (this.attachment == attachment)
+				return;
+			this.attachment = attachment;
+			this.attachmentTime = this.bone.skeleton.time;
+			this.attachmentVertices.length = 0;
 		};
 		};
-		Color.prototype.setFromString = function (hex) {
-			hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;
-			this.r = parseInt(hex.substr(0, 2), 16) / 255.0;
-			this.g = parseInt(hex.substr(2, 2), 16) / 255.0;
-			this.b = parseInt(hex.substr(4, 2), 16) / 255.0;
-			this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;
-			return this;
+		Slot.prototype.setAttachmentTime = function (time) {
+			this.attachmentTime = this.bone.skeleton.time - time;
 		};
 		};
-		Color.prototype.add = function (r, g, b, a) {
-			this.r += r;
-			this.g += g;
-			this.b += b;
-			this.a += a;
-			this.clamp();
-			return this;
+		Slot.prototype.getAttachmentTime = function () {
+			return this.bone.skeleton.time - this.attachmentTime;
 		};
 		};
-		Color.prototype.clamp = function () {
-			if (this.r < 0)
-				this.r = 0;
-			else if (this.r > 1)
-				this.r = 1;
-			if (this.g < 0)
-				this.g = 0;
-			else if (this.g > 1)
-				this.g = 1;
-			if (this.b < 0)
-				this.b = 0;
-			else if (this.b > 1)
-				this.b = 1;
-			if (this.a < 0)
-				this.a = 0;
-			else if (this.a > 1)
-				this.a = 1;
-			return this;
+		Slot.prototype.setToSetupPose = function () {
+			this.color.setFromColor(this.data.color);
+			if (this.darkColor != null)
+				this.darkColor.setFromColor(this.data.darkColor);
+			if (this.data.attachmentName == null)
+				this.attachment = null;
+			else {
+				this.attachment = null;
+				this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));
+			}
 		};
 		};
-		return Color;
+		return Slot;
 	}());
 	}());
-	Color.WHITE = new Color(1, 1, 1, 1);
-	Color.RED = new Color(1, 0, 0, 1);
-	Color.GREEN = new Color(0, 1, 0, 1);
-	Color.BLUE = new Color(0, 0, 1, 1);
-	Color.MAGENTA = new Color(1, 0, 1, 1);
-	spine.Color = Color;
-	var MathUtils = (function () {
-		function MathUtils() {
+	spine.Slot = Slot;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var SlotData = (function () {
+		function SlotData(index, name, boneData) {
+			this.color = new spine.Color(1, 1, 1, 1);
+			if (index < 0)
+				throw new Error("index must be >= 0.");
+			if (name == null)
+				throw new Error("name cannot be null.");
+			if (boneData == null)
+				throw new Error("boneData cannot be null.");
+			this.index = index;
+			this.name = name;
+			this.boneData = boneData;
 		}
 		}
-		MathUtils.clamp = function (value, min, max) {
-			if (value < min)
-				return min;
-			if (value > max)
-				return max;
-			return value;
-		};
-		MathUtils.cosDeg = function (degrees) {
-			return Math.cos(degrees * MathUtils.degRad);
-		};
-		MathUtils.sinDeg = function (degrees) {
-			return Math.sin(degrees * MathUtils.degRad);
-		};
-		MathUtils.signum = function (value) {
-			return value > 0 ? 1 : value < 0 ? -1 : 0;
-		};
-		MathUtils.toInt = function (x) {
-			return x > 0 ? Math.floor(x) : Math.ceil(x);
-		};
-		MathUtils.cbrt = function (x) {
-			var y = Math.pow(Math.abs(x), 1 / 3);
-			return x < 0 ? -y : y;
-		};
-		return MathUtils;
+		return SlotData;
 	}());
 	}());
-	MathUtils.PI = 3.1415927;
-	MathUtils.PI2 = MathUtils.PI * 2;
-	MathUtils.radiansToDegrees = 180 / MathUtils.PI;
-	MathUtils.radDeg = MathUtils.radiansToDegrees;
-	MathUtils.degreesToRadians = MathUtils.PI / 180;
-	MathUtils.degRad = MathUtils.degreesToRadians;
-	spine.MathUtils = MathUtils;
-	var Utils = (function () {
-		function Utils() {
+	spine.SlotData = SlotData;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var Texture = (function () {
+		function Texture(image) {
+			this._image = image;
 		}
 		}
-		Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {
-			for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {
-				dest[j] = source[i];
-			}
-		};
-		Utils.setArraySize = function (array, size, value) {
-			if (value === void 0) { value = 0; }
-			var oldSize = array.length;
-			if (oldSize == size)
-				return array;
-			array.length = size;
-			if (oldSize < size) {
-				for (var i = oldSize; i < size; i++)
-					array[i] = value;
-			}
-			return array;
-		};
-		Utils.ensureArrayCapacity = function (array, size, value) {
-			if (value === void 0) { value = 0; }
-			if (array.length >= size)
-				return array;
-			return Utils.setArraySize(array, size, value);
-		};
-		Utils.newArray = function (size, defaultValue) {
-			var array = new Array(size);
-			for (var i = 0; i < size; i++)
-				array[i] = defaultValue;
-			return array;
+		Texture.prototype.getImage = function () {
+			return this._image;
 		};
 		};
-		Utils.newFloatArray = function (size) {
-			if (Utils.SUPPORTS_TYPED_ARRAYS) {
-				return new Float32Array(size);
-			}
-			else {
-				var array = new Array(size);
-				for (var i = 0; i < array.length; i++)
-					array[i] = 0;
-				return array;
+		Texture.filterFromString = function (text) {
+			switch (text.toLowerCase()) {
+				case "nearest": return TextureFilter.Nearest;
+				case "linear": return TextureFilter.Linear;
+				case "mipmap": return TextureFilter.MipMap;
+				case "mipmapnearestnearest": return TextureFilter.MipMapNearestNearest;
+				case "mipmaplinearnearest": return TextureFilter.MipMapLinearNearest;
+				case "mipmapnearestlinear": return TextureFilter.MipMapNearestLinear;
+				case "mipmaplinearlinear": return TextureFilter.MipMapLinearLinear;
+				default: throw new Error("Unknown texture filter " + text);
 			}
 			}
 		};
 		};
-		Utils.newShortArray = function (size) {
-			if (Utils.SUPPORTS_TYPED_ARRAYS) {
-				return new Int16Array(size);
-			}
-			else {
-				var array = new Array(size);
-				for (var i = 0; i < array.length; i++)
-					array[i] = 0;
-				return array;
+		Texture.wrapFromString = function (text) {
+			switch (text.toLowerCase()) {
+				case "mirroredtepeat": return TextureWrap.MirroredRepeat;
+				case "clamptoedge": return TextureWrap.ClampToEdge;
+				case "repeat": return TextureWrap.Repeat;
+				default: throw new Error("Unknown texture wrap " + text);
 			}
 			}
 		};
 		};
-		Utils.toFloatArray = function (array) {
-			return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;
-		};
-		return Utils;
+		return Texture;
 	}());
 	}());
-	Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined";
-	spine.Utils = Utils;
-	var DebugUtils = (function () {
-		function DebugUtils() {
+	spine.Texture = Texture;
+	(function (TextureFilter) {
+		TextureFilter[TextureFilter["Nearest"] = 9728] = "Nearest";
+		TextureFilter[TextureFilter["Linear"] = 9729] = "Linear";
+		TextureFilter[TextureFilter["MipMap"] = 9987] = "MipMap";
+		TextureFilter[TextureFilter["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest";
+		TextureFilter[TextureFilter["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest";
+		TextureFilter[TextureFilter["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear";
+		TextureFilter[TextureFilter["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear";
+	})(spine.TextureFilter || (spine.TextureFilter = {}));
+	var TextureFilter = spine.TextureFilter;
+	(function (TextureWrap) {
+		TextureWrap[TextureWrap["MirroredRepeat"] = 33648] = "MirroredRepeat";
+		TextureWrap[TextureWrap["ClampToEdge"] = 33071] = "ClampToEdge";
+		TextureWrap[TextureWrap["Repeat"] = 10497] = "Repeat";
+	})(spine.TextureWrap || (spine.TextureWrap = {}));
+	var TextureWrap = spine.TextureWrap;
+	var TextureRegion = (function () {
+		function TextureRegion() {
+			this.u = 0;
+			this.v = 0;
+			this.u2 = 0;
+			this.v2 = 0;
+			this.width = 0;
+			this.height = 0;
+			this.rotate = false;
+			this.offsetX = 0;
+			this.offsetY = 0;
+			this.originalWidth = 0;
+			this.originalHeight = 0;
 		}
 		}
-		DebugUtils.logBones = function (skeleton) {
-			for (var i = 0; i < skeleton.bones.length; i++) {
-				var bone = skeleton.bones[i];
-				console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY);
+		return TextureRegion;
+	}());
+	spine.TextureRegion = TextureRegion;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var TextureAtlas = (function () {
+		function TextureAtlas(atlasText, textureLoader) {
+			this.pages = new Array();
+			this.regions = new Array();
+			this.load(atlasText, textureLoader);
+		}
+		TextureAtlas.prototype.load = function (atlasText, textureLoader) {
+			if (textureLoader == null)
+				throw new Error("textureLoader cannot be null.");
+			var reader = new TextureAtlasReader(atlasText);
+			var tuple = new Array(4);
+			var page = null;
+			while (true) {
+				var line = reader.readLine();
+				if (line == null)
+					break;
+				line = line.trim();
+				if (line.length == 0)
+					page = null;
+				else if (!page) {
+					page = new TextureAtlasPage();
+					page.name = line;
+					if (reader.readTuple(tuple) == 2) {
+						page.width = parseInt(tuple[0]);
+						page.height = parseInt(tuple[1]);
+						reader.readTuple(tuple);
+					}
+					reader.readTuple(tuple);
+					page.minFilter = spine.Texture.filterFromString(tuple[0]);
+					page.magFilter = spine.Texture.filterFromString(tuple[1]);
+					var direction = reader.readValue();
+					page.uWrap = spine.TextureWrap.ClampToEdge;
+					page.vWrap = spine.TextureWrap.ClampToEdge;
+					if (direction == "x")
+						page.uWrap = spine.TextureWrap.Repeat;
+					else if (direction == "y")
+						page.vWrap = spine.TextureWrap.Repeat;
+					else if (direction == "xy")
+						page.uWrap = page.vWrap = spine.TextureWrap.Repeat;
+					page.texture = textureLoader(line);
+					page.texture.setFilters(page.minFilter, page.magFilter);
+					page.texture.setWraps(page.uWrap, page.vWrap);
+					page.width = page.texture.getImage().width;
+					page.height = page.texture.getImage().height;
+					this.pages.push(page);
+				}
+				else {
+					var region = new TextureAtlasRegion();
+					region.name = line;
+					region.page = page;
+					region.rotate = reader.readValue() == "true";
+					reader.readTuple(tuple);
+					var x = parseInt(tuple[0]);
+					var y = parseInt(tuple[1]);
+					reader.readTuple(tuple);
+					var width = parseInt(tuple[0]);
+					var height = parseInt(tuple[1]);
+					region.u = x / page.width;
+					region.v = y / page.height;
+					if (region.rotate) {
+						region.u2 = (x + height) / page.width;
+						region.v2 = (y + width) / page.height;
+					}
+					else {
+						region.u2 = (x + width) / page.width;
+						region.v2 = (y + height) / page.height;
+					}
+					region.x = x;
+					region.y = y;
+					region.width = Math.abs(width);
+					region.height = Math.abs(height);
+					if (reader.readTuple(tuple) == 4) {
+						if (reader.readTuple(tuple) == 4) {
+							reader.readTuple(tuple);
+						}
+					}
+					region.originalWidth = parseInt(tuple[0]);
+					region.originalHeight = parseInt(tuple[1]);
+					reader.readTuple(tuple);
+					region.offsetX = parseInt(tuple[0]);
+					region.offsetY = parseInt(tuple[1]);
+					region.index = parseInt(reader.readValue());
+					region.texture = page.texture;
+					this.regions.push(region);
+				}
 			}
 			}
 		};
 		};
-		return DebugUtils;
+		TextureAtlas.prototype.findRegion = function (name) {
+			for (var i = 0; i < this.regions.length; i++) {
+				if (this.regions[i].name == name) {
+					return this.regions[i];
+				}
+			}
+			return null;
+		};
+		TextureAtlas.prototype.dispose = function () {
+			for (var i = 0; i < this.pages.length; i++) {
+				this.pages[i].texture.dispose();
+			}
+		};
+		return TextureAtlas;
 	}());
 	}());
-	spine.DebugUtils = DebugUtils;
-	var Pool = (function () {
-		function Pool(instantiator) {
-			this.items = new Array();
-			this.instantiator = instantiator;
+	spine.TextureAtlas = TextureAtlas;
+	var TextureAtlasReader = (function () {
+		function TextureAtlasReader(text) {
+			this.index = 0;
+			this.lines = text.split(/\r\n|\r|\n/);
 		}
 		}
-		Pool.prototype.obtain = function () {
-			return this.items.length > 0 ? this.items.pop() : this.instantiator();
+		TextureAtlasReader.prototype.readLine = function () {
+			if (this.index >= this.lines.length)
+				return null;
+			return this.lines[this.index++];
 		};
 		};
-		Pool.prototype.free = function (item) {
-			if (item.reset)
-				item.reset();
-			this.items.push(item);
+		TextureAtlasReader.prototype.readValue = function () {
+			var line = this.readLine();
+			var colon = line.indexOf(":");
+			if (colon == -1)
+				throw new Error("Invalid line: " + line);
+			return line.substring(colon + 1).trim();
 		};
 		};
-		Pool.prototype.freeAll = function (items) {
-			for (var i = 0; i < items.length; i++) {
-				if (items[i].reset)
-					items[i].reset();
-				this.items[i] = items[i];
+		TextureAtlasReader.prototype.readTuple = function (tuple) {
+			var line = this.readLine();
+			var colon = line.indexOf(":");
+			if (colon == -1)
+				throw new Error("Invalid line: " + line);
+			var i = 0, lastMatch = colon + 1;
+			for (; i < 3; i++) {
+				var comma = line.indexOf(",", lastMatch);
+				if (comma == -1)
+					break;
+				tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();
+				lastMatch = comma + 1;
 			}
 			}
+			tuple[i] = line.substring(lastMatch).trim();
+			return i + 1;
 		};
 		};
-		Pool.prototype.clear = function () {
-			this.items.length = 0;
-		};
-		return Pool;
+		return TextureAtlasReader;
 	}());
 	}());
-	spine.Pool = Pool;
-	var Vector2 = (function () {
-		function Vector2(x, y) {
-			if (x === void 0) { x = 0; }
-			if (y === void 0) { y = 0; }
-			this.x = x;
-			this.y = y;
+	var TextureAtlasPage = (function () {
+		function TextureAtlasPage() {
 		}
 		}
-		Vector2.prototype.set = function (x, y) {
-			this.x = x;
-			this.y = y;
-			return this;
-		};
-		Vector2.prototype.length = function () {
-			var x = this.x;
-			var y = this.y;
-			return Math.sqrt(x * x + y * y);
+		return TextureAtlasPage;
+	}());
+	spine.TextureAtlasPage = TextureAtlasPage;
+	var TextureAtlasRegion = (function (_super) {
+		__extends(TextureAtlasRegion, _super);
+		function TextureAtlasRegion() {
+			_super.apply(this, arguments);
+		}
+		return TextureAtlasRegion;
+	}(spine.TextureRegion));
+	spine.TextureAtlasRegion = TextureAtlasRegion;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var TransformConstraint = (function () {
+		function TransformConstraint(data, skeleton) {
+			this.rotateMix = 0;
+			this.translateMix = 0;
+			this.scaleMix = 0;
+			this.shearMix = 0;
+			this.temp = new spine.Vector2();
+			if (data == null)
+				throw new Error("data cannot be null.");
+			if (skeleton == null)
+				throw new Error("skeleton cannot be null.");
+			this.data = data;
+			this.rotateMix = data.rotateMix;
+			this.translateMix = data.translateMix;
+			this.scaleMix = data.scaleMix;
+			this.shearMix = data.shearMix;
+			this.bones = new Array();
+			for (var i = 0; i < data.bones.length; i++)
+				this.bones.push(skeleton.findBone(data.bones[i].name));
+			this.target = skeleton.findBone(data.target.name);
+		}
+		TransformConstraint.prototype.apply = function () {
+			this.update();
 		};
 		};
-		Vector2.prototype.normalize = function () {
-			var len = this.length();
-			if (len != 0) {
-				this.x /= len;
-				this.y /= len;
+		TransformConstraint.prototype.update = function () {
+			if (this.data.local) {
+				if (this.data.relative)
+					this.applyRelativeLocal();
+				else
+					this.applyAbsoluteLocal();
+			}
+			else {
+				if (this.data.relative)
+					this.applyRelativeWorld();
+				else
+					this.applyAbsoluteWorld();
 			}
 			}
-			return this;
 		};
 		};
-		return Vector2;
-	}());
-	spine.Vector2 = Vector2;
-	var TimeKeeper = (function () {
-		function TimeKeeper() {
-			this.maxDelta = 0.064;
-			this.framesPerSecond = 0;
-			this.delta = 0;
-			this.totalTime = 0;
-			this.lastTime = Date.now() / 1000;
-			this.frameCount = 0;
-			this.frameTime = 0;
-		}
-		TimeKeeper.prototype.update = function () {
-			var now = Date.now() / 1000;
-			this.delta = now - this.lastTime;
-			this.frameTime += this.delta;
-			this.totalTime += this.delta;
-			if (this.delta > this.maxDelta)
-				this.delta = this.maxDelta;
-			this.lastTime = now;
-			this.frameCount++;
-			if (this.frameTime > 1) {
-				this.framesPerSecond = this.frameCount / this.frameTime;
-				this.frameTime = 0;
-				this.frameCount = 0;
+		TransformConstraint.prototype.applyAbsoluteWorld = function () {
+			var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;
+			var target = this.target;
+			var ta = target.a, tb = target.b, tc = target.c, td = target.d;
+			var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;
+			var offsetRotation = this.data.offsetRotation * degRadReflect;
+			var offsetShearY = this.data.offsetShearY * degRadReflect;
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++) {
+				var bone = bones[i];
+				var modified = false;
+				if (rotateMix != 0) {
+					var a = bone.a, b = bone.b, c = bone.c, d = bone.d;
+					var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;
+					if (r > spine.MathUtils.PI)
+						r -= spine.MathUtils.PI2;
+					else if (r < -spine.MathUtils.PI)
+						r += spine.MathUtils.PI2;
+					r *= rotateMix;
+					var cos = Math.cos(r), sin = Math.sin(r);
+					bone.a = cos * a - sin * c;
+					bone.b = cos * b - sin * d;
+					bone.c = sin * a + cos * c;
+					bone.d = sin * b + cos * d;
+					modified = true;
+				}
+				if (translateMix != 0) {
+					var temp = this.temp;
+					target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));
+					bone.worldX += (temp.x - bone.worldX) * translateMix;
+					bone.worldY += (temp.y - bone.worldY) * translateMix;
+					modified = true;
+				}
+				if (scaleMix > 0) {
+					var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);
+					var ts = Math.sqrt(ta * ta + tc * tc);
+					if (s > 0.00001)
+						s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;
+					bone.a *= s;
+					bone.c *= s;
+					s = Math.sqrt(bone.b * bone.b + bone.d * bone.d);
+					ts = Math.sqrt(tb * tb + td * td);
+					if (s > 0.00001)
+						s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;
+					bone.b *= s;
+					bone.d *= s;
+					modified = true;
+				}
+				if (shearMix > 0) {
+					var b = bone.b, d = bone.d;
+					var by = Math.atan2(d, b);
+					var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));
+					if (r > spine.MathUtils.PI)
+						r -= spine.MathUtils.PI2;
+					else if (r < -spine.MathUtils.PI)
+						r += spine.MathUtils.PI2;
+					r = by + (r + offsetShearY) * shearMix;
+					var s = Math.sqrt(b * b + d * d);
+					bone.b = Math.cos(r) * s;
+					bone.d = Math.sin(r) * s;
+					modified = true;
+				}
+				if (modified)
+					bone.appliedValid = false;
 			}
 			}
 		};
 		};
-		return TimeKeeper;
-	}());
-	spine.TimeKeeper = TimeKeeper;
-	var WindowedMean = (function () {
-		function WindowedMean(windowSize) {
-			if (windowSize === void 0) { windowSize = 32; }
-			this.addedValues = 0;
-			this.lastValue = 0;
-			this.mean = 0;
-			this.dirty = true;
-			this.values = new Array(windowSize);
-		}
-		WindowedMean.prototype.hasEnoughData = function () {
-			return this.addedValues >= this.values.length;
+		TransformConstraint.prototype.applyRelativeWorld = function () {
+			var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;
+			var target = this.target;
+			var ta = target.a, tb = target.b, tc = target.c, td = target.d;
+			var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;
+			var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++) {
+				var bone = bones[i];
+				var modified = false;
+				if (rotateMix != 0) {
+					var a = bone.a, b = bone.b, c = bone.c, d = bone.d;
+					var r = Math.atan2(tc, ta) + offsetRotation;
+					if (r > spine.MathUtils.PI)
+						r -= spine.MathUtils.PI2;
+					else if (r < -spine.MathUtils.PI)
+						r += spine.MathUtils.PI2;
+					r *= rotateMix;
+					var cos = Math.cos(r), sin = Math.sin(r);
+					bone.a = cos * a - sin * c;
+					bone.b = cos * b - sin * d;
+					bone.c = sin * a + cos * c;
+					bone.d = sin * b + cos * d;
+					modified = true;
+				}
+				if (translateMix != 0) {
+					var temp = this.temp;
+					target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));
+					bone.worldX += temp.x * translateMix;
+					bone.worldY += temp.y * translateMix;
+					modified = true;
+				}
+				if (scaleMix > 0) {
+					var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;
+					bone.a *= s;
+					bone.c *= s;
+					s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;
+					bone.b *= s;
+					bone.d *= s;
+					modified = true;
+				}
+				if (shearMix > 0) {
+					var r = Math.atan2(td, tb) - Math.atan2(tc, ta);
+					if (r > spine.MathUtils.PI)
+						r -= spine.MathUtils.PI2;
+					else if (r < -spine.MathUtils.PI)
+						r += spine.MathUtils.PI2;
+					var b = bone.b, d = bone.d;
+					r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix;
+					var s = Math.sqrt(b * b + d * d);
+					bone.b = Math.cos(r) * s;
+					bone.d = Math.sin(r) * s;
+					modified = true;
+				}
+				if (modified)
+					bone.appliedValid = false;
+			}
 		};
 		};
-		WindowedMean.prototype.addValue = function (value) {
-			if (this.addedValues < this.values.length)
-				this.addedValues++;
-			this.values[this.lastValue++] = value;
-			if (this.lastValue > this.values.length - 1)
-				this.lastValue = 0;
-			this.dirty = true;
+		TransformConstraint.prototype.applyAbsoluteLocal = function () {
+			var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;
+			var target = this.target;
+			if (!target.appliedValid)
+				target.updateAppliedTransform();
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++) {
+				var bone = bones[i];
+				if (!bone.appliedValid)
+					bone.updateAppliedTransform();
+				var rotation = bone.arotation;
+				if (rotateMix != 0) {
+					var r = target.arotation - rotation + this.data.offsetRotation;
+					r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;
+					rotation += r * rotateMix;
+				}
+				var x = bone.ax, y = bone.ay;
+				if (translateMix != 0) {
+					x += (target.ax - x + this.data.offsetX) * translateMix;
+					y += (target.ay - y + this.data.offsetY) * translateMix;
+				}
+				var scaleX = bone.ascaleX, scaleY = bone.ascaleY;
+				if (scaleMix > 0) {
+					if (scaleX > 0.00001)
+						scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;
+					if (scaleY > 0.00001)
+						scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;
+				}
+				var shearY = bone.ashearY;
+				if (shearMix > 0) {
+					var r = target.ashearY - shearY + this.data.offsetShearY;
+					r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;
+					bone.shearY += r * shearMix;
+				}
+				bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
+			}
 		};
 		};
-		WindowedMean.prototype.getMean = function () {
-			if (this.hasEnoughData()) {
-				if (this.dirty) {
-					var mean = 0;
-					for (var i = 0; i < this.values.length; i++) {
-						mean += this.values[i];
-					}
-					this.mean = mean / this.values.length;
-					this.dirty = false;
+		TransformConstraint.prototype.applyRelativeLocal = function () {
+			var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;
+			var target = this.target;
+			if (!target.appliedValid)
+				target.updateAppliedTransform();
+			var bones = this.bones;
+			for (var i = 0, n = bones.length; i < n; i++) {
+				var bone = bones[i];
+				if (!bone.appliedValid)
+					bone.updateAppliedTransform();
+				var rotation = bone.arotation;
+				if (rotateMix != 0)
+					rotation += (target.arotation + this.data.offsetRotation) * rotateMix;
+				var x = bone.ax, y = bone.ay;
+				if (translateMix != 0) {
+					x += (target.ax + this.data.offsetX) * translateMix;
+					y += (target.ay + this.data.offsetY) * translateMix;
 				}
 				}
-				return this.mean;
-			}
-			else {
-				return 0;
+				var scaleX = bone.ascaleX, scaleY = bone.ascaleY;
+				if (scaleMix > 0) {
+					if (scaleX > 0.00001)
+						scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;
+					if (scaleY > 0.00001)
+						scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;
+				}
+				var shearY = bone.ashearY;
+				if (shearMix > 0)
+					shearY += (target.ashearY + this.data.offsetShearY) * shearMix;
+				bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
 			}
 			}
 		};
 		};
-		return WindowedMean;
+		TransformConstraint.prototype.getOrder = function () {
+			return this.data.order;
+		};
+		return TransformConstraint;
 	}());
 	}());
-	spine.WindowedMean = WindowedMean;
+	spine.TransformConstraint = TransformConstraint;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var Attachment = (function () {
-		function Attachment(name) {
+	var TransformConstraintData = (function () {
+		function TransformConstraintData(name) {
+			this.order = 0;
+			this.bones = new Array();
+			this.rotateMix = 0;
+			this.translateMix = 0;
+			this.scaleMix = 0;
+			this.shearMix = 0;
+			this.offsetRotation = 0;
+			this.offsetX = 0;
+			this.offsetY = 0;
+			this.offsetScaleX = 0;
+			this.offsetScaleY = 0;
+			this.offsetShearY = 0;
+			this.relative = false;
+			this.local = false;
 			if (name == null)
 			if (name == null)
 				throw new Error("name cannot be null.");
 				throw new Error("name cannot be null.");
 			this.name = name;
 			this.name = name;
 		}
 		}
-		return Attachment;
+		return TransformConstraintData;
 	}());
 	}());
-	spine.Attachment = Attachment;
-	var VertexAttachment = (function (_super) {
-		__extends(VertexAttachment, _super);
-		function VertexAttachment(name) {
-			var _this = _super.call(this, name) || this;
-			_this.worldVerticesLength = 0;
-			return _this;
+	spine.TransformConstraintData = TransformConstraintData;
+})(spine || (spine = {}));
+var spine;
+(function (spine) {
+	var Triangulator = (function () {
+		function Triangulator() {
+			this.convexPolygons = new Array();
+			this.convexPolygonsIndices = new Array();
+			this.indicesArray = new Array();
+			this.isConcaveArray = new Array();
+			this.triangles = new Array();
+			this.polygonPool = new spine.Pool(function () {
+				return new Array();
+			});
+			this.polygonIndicesPool = new spine.Pool(function () {
+				return new Array();
+			});
 		}
 		}
-		VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {
-			count = offset + (count >> 1) * stride;
-			var skeleton = slot.bone.skeleton;
-			var deformArray = slot.attachmentVertices;
-			var vertices = this.vertices;
-			var bones = this.bones;
-			if (bones == null) {
-				if (deformArray.length > 0)
-					vertices = deformArray;
-				var bone = slot.bone;
-				var x = bone.worldX;
-				var y = bone.worldY;
-				var a = bone.a, b = bone.b, c = bone.c, d = bone.d;
-				for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {
-					var vx = vertices[v_1], vy = vertices[v_1 + 1];
-					worldVertices[w] = vx * a + vy * b + x;
-					worldVertices[w + 1] = vx * c + vy * d + y;
+		Triangulator.prototype.triangulate = function (verticesArray) {
+			var vertices = verticesArray;
+			var vertexCount = verticesArray.length >> 1;
+			var indices = this.indicesArray;
+			indices.length = 0;
+			for (var i = 0; i < vertexCount; i++)
+				indices[i] = i;
+			var isConcave = this.isConcaveArray;
+			isConcave.length = 0;
+			for (var i = 0, n = vertexCount; i < n; ++i)
+				isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);
+			var triangles = this.triangles;
+			triangles.length = 0;
+			while (vertexCount > 3) {
+				var previous = vertexCount - 1, i = 0, next = 1;
+				while (true) {
+					outer: if (!isConcave[i]) {
+						var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;
+						var p1x = vertices[p1], p1y = vertices[p1 + 1];
+						var p2x = vertices[p2], p2y = vertices[p2 + 1];
+						var p3x = vertices[p3], p3y = vertices[p3 + 1];
+						for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {
+							if (!isConcave[ii])
+								continue;
+							var v = indices[ii] << 1;
+							var vx = vertices[v], vy = vertices[v + 1];
+							if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {
+								if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {
+									if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy))
+										break outer;
+								}
+							}
+						}
+						break;
+					}
+					if (next == 0) {
+						do {
+							if (!isConcave[i])
+								break;
+							i--;
+						} while (i > 0);
+						break;
+					}
+					previous = i;
+					i = next;
+					next = (next + 1) % vertexCount;
 				}
 				}
-				return;
+				triangles.push(indices[(vertexCount + i - 1) % vertexCount]);
+				triangles.push(indices[i]);
+				triangles.push(indices[(i + 1) % vertexCount]);
+				indices.splice(i, 1);
+				isConcave.splice(i, 1);
+				vertexCount--;
+				var previousIndex = (vertexCount + i - 1) % vertexCount;
+				var nextIndex = i == vertexCount ? 0 : i;
+				isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);
+				isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);
 			}
 			}
-			var v = 0, skip = 0;
-			for (var i = 0; i < start; i += 2) {
-				var n = bones[v];
-				v += n + 1;
-				skip += n;
+			if (vertexCount == 3) {
+				triangles.push(indices[2]);
+				triangles.push(indices[0]);
+				triangles.push(indices[1]);
 			}
 			}
-			var skeletonBones = skeleton.bones;
-			if (deformArray.length == 0) {
-				for (var w = offset, b = skip * 3; w < count; w += stride) {
-					var wx = 0, wy = 0;
-					var n = bones[v++];
-					n += v;
-					for (; v < n; v++, b += 3) {
-						var bone = skeletonBones[bones[v]];
-						var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];
-						wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;
-						wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;
+			return triangles;
+		};
+		Triangulator.prototype.decompose = function (verticesArray, triangles) {
+			var vertices = verticesArray;
+			var convexPolygons = this.convexPolygons;
+			this.polygonPool.freeAll(convexPolygons);
+			convexPolygons.length = 0;
+			var convexPolygonsIndices = this.convexPolygonsIndices;
+			this.polygonIndicesPool.freeAll(convexPolygonsIndices);
+			convexPolygonsIndices.length = 0;
+			var polygonIndices = this.polygonIndicesPool.obtain();
+			polygonIndices.length = 0;
+			var polygon = this.polygonPool.obtain();
+			polygon.length = 0;
+			var fanBaseIndex = -1, lastWinding = 0;
+			for (var i = 0, n = triangles.length; i < n; i += 3) {
+				var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;
+				var x1 = vertices[t1], y1 = vertices[t1 + 1];
+				var x2 = vertices[t2], y2 = vertices[t2 + 1];
+				var x3 = vertices[t3], y3 = vertices[t3 + 1];
+				var merged = false;
+				if (fanBaseIndex == t1) {
+					var o = polygon.length - 4;
+					var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);
+					var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);
+					if (winding1 == lastWinding && winding2 == lastWinding) {
+						polygon.push(x3);
+						polygon.push(y3);
+						polygonIndices.push(t3);
+						merged = true;
+					}
+				}
+				if (!merged) {
+					if (polygon.length > 0) {
+						convexPolygons.push(polygon);
+						convexPolygonsIndices.push(polygonIndices);
+					}
+					else {
+						this.polygonPool.free(polygon);
+						this.polygonIndicesPool.free(polygonIndices);
+					}
+					polygon = this.polygonPool.obtain();
+					polygon.length = 0;
+					polygon.push(x1);
+					polygon.push(y1);
+					polygon.push(x2);
+					polygon.push(y2);
+					polygon.push(x3);
+					polygon.push(y3);
+					polygonIndices = this.polygonIndicesPool.obtain();
+					polygonIndices.length = 0;
+					polygonIndices.push(t1);
+					polygonIndices.push(t2);
+					polygonIndices.push(t3);
+					lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);
+					fanBaseIndex = t1;
+				}
+			}
+			if (polygon.length > 0) {
+				convexPolygons.push(polygon);
+				convexPolygonsIndices.push(polygonIndices);
+			}
+			for (var i = 0, n = convexPolygons.length; i < n; i++) {
+				polygonIndices = convexPolygonsIndices[i];
+				if (polygonIndices.length == 0)
+					continue;
+				var firstIndex = polygonIndices[0];
+				var lastIndex = polygonIndices[polygonIndices.length - 1];
+				polygon = convexPolygons[i];
+				var o = polygon.length - 4;
+				var prevPrevX = polygon[o], prevPrevY = polygon[o + 1];
+				var prevX = polygon[o + 2], prevY = polygon[o + 3];
+				var firstX = polygon[0], firstY = polygon[1];
+				var secondX = polygon[2], secondY = polygon[3];
+				var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);
+				for (var ii = 0; ii < n; ii++) {
+					if (ii == i)
+						continue;
+					var otherIndices = convexPolygonsIndices[ii];
+					if (otherIndices.length != 3)
+						continue;
+					var otherFirstIndex = otherIndices[0];
+					var otherSecondIndex = otherIndices[1];
+					var otherLastIndex = otherIndices[2];
+					var otherPoly = convexPolygons[ii];
+					var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];
+					if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex)
+						continue;
+					var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);
+					var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);
+					if (winding1 == winding && winding2 == winding) {
+						otherPoly.length = 0;
+						otherIndices.length = 0;
+						polygon.push(x3);
+						polygon.push(y3);
+						polygonIndices.push(otherLastIndex);
+						prevPrevX = prevX;
+						prevPrevY = prevY;
+						prevX = x3;
+						prevY = y3;
+						ii = 0;
 					}
 					}
-					worldVertices[w] = wx;
-					worldVertices[w + 1] = wy;
 				}
 				}
 			}
 			}
-			else {
-				var deform = deformArray;
-				for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {
-					var wx = 0, wy = 0;
-					var n = bones[v++];
-					n += v;
-					for (; v < n; v++, b += 3, f += 2) {
-						var bone = skeletonBones[bones[v]];
-						var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];
-						wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;
-						wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;
-					}
-					worldVertices[w] = wx;
-					worldVertices[w + 1] = wy;
+			for (var i = convexPolygons.length - 1; i >= 0; i--) {
+				polygon = convexPolygons[i];
+				if (polygon.length == 0) {
+					convexPolygons.splice(i, 1);
+					this.polygonPool.free(polygon);
+					polygonIndices = convexPolygonsIndices[i];
+					convexPolygonsIndices.splice(i, 1);
+					this.polygonIndicesPool.free(polygonIndices);
 				}
 				}
 			}
 			}
+			return convexPolygons;
 		};
 		};
-		VertexAttachment.prototype.applyDeform = function (sourceAttachment) {
-			return this == sourceAttachment;
+		Triangulator.isConcave = function (index, vertexCount, vertices, indices) {
+			var previous = indices[(vertexCount + index - 1) % vertexCount] << 1;
+			var current = indices[index] << 1;
+			var next = indices[(index + 1) % vertexCount] << 1;
+			return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);
 		};
 		};
-		return VertexAttachment;
-	}(Attachment));
-	spine.VertexAttachment = VertexAttachment;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var AttachmentType;
-	(function (AttachmentType) {
-		AttachmentType[AttachmentType["Region"] = 0] = "Region";
-		AttachmentType[AttachmentType["BoundingBox"] = 1] = "BoundingBox";
-		AttachmentType[AttachmentType["Mesh"] = 2] = "Mesh";
-		AttachmentType[AttachmentType["LinkedMesh"] = 3] = "LinkedMesh";
-		AttachmentType[AttachmentType["Path"] = 4] = "Path";
-		AttachmentType[AttachmentType["Point"] = 5] = "Point";
-	})(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {}));
+		Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) {
+			return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;
+		};
+		Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) {
+			var px = p2x - p1x, py = p2y - p1y;
+			return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;
+		};
+		return Triangulator;
+	}());
+	spine.Triangulator = Triangulator;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 var spine;
 var spine;
 (function (spine) {
 (function (spine) {
-	var BoundingBoxAttachment = (function (_super) {
-		__extends(BoundingBoxAttachment, _super);
-		function BoundingBoxAttachment(name) {
-			var _this = _super.call(this, name) || this;
-			_this.color = new spine.Color(1, 1, 1, 1);
-			return _this;
+	var IntSet = (function () {
+		function IntSet() {
+			this.array = new Array();
 		}
 		}
-		return BoundingBoxAttachment;
-	}(spine.VertexAttachment));
-	spine.BoundingBoxAttachment = BoundingBoxAttachment;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var ClippingAttachment = (function (_super) {
-		__extends(ClippingAttachment, _super);
-		function ClippingAttachment(name) {
-			var _this = _super.call(this, name) || this;
-			_this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1);
-			return _this;
+		IntSet.prototype.add = function (value) {
+			var contains = this.contains(value);
+			this.array[value | 0] = value | 0;
+			return !contains;
+		};
+		IntSet.prototype.contains = function (value) {
+			return this.array[value | 0] != undefined;
+		};
+		IntSet.prototype.remove = function (value) {
+			this.array[value | 0] = undefined;
+		};
+		IntSet.prototype.clear = function () {
+			this.array.length = 0;
+		};
+		return IntSet;
+	}());
+	spine.IntSet = IntSet;
+	var Color = (function () {
+		function Color(r, g, b, a) {
+			if (r === void 0) { r = 0; }
+			if (g === void 0) { g = 0; }
+			if (b === void 0) { b = 0; }
+			if (a === void 0) { a = 0; }
+			this.r = r;
+			this.g = g;
+			this.b = b;
+			this.a = a;
 		}
 		}
-		return ClippingAttachment;
-	}(spine.VertexAttachment));
-	spine.ClippingAttachment = ClippingAttachment;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var MeshAttachment = (function (_super) {
-		__extends(MeshAttachment, _super);
-		function MeshAttachment(name) {
-			var _this = _super.call(this, name) || this;
-			_this.color = new spine.Color(1, 1, 1, 1);
-			_this.inheritDeform = false;
-			_this.tempColor = new spine.Color(0, 0, 0, 0);
-			return _this;
+		Color.prototype.set = function (r, g, b, a) {
+			this.r = r;
+			this.g = g;
+			this.b = b;
+			this.a = a;
+			this.clamp();
+			return this;
+		};
+		Color.prototype.setFromColor = function (c) {
+			this.r = c.r;
+			this.g = c.g;
+			this.b = c.b;
+			this.a = c.a;
+			return this;
+		};
+		Color.prototype.setFromString = function (hex) {
+			hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;
+			this.r = parseInt(hex.substr(0, 2), 16) / 255.0;
+			this.g = parseInt(hex.substr(2, 2), 16) / 255.0;
+			this.b = parseInt(hex.substr(4, 2), 16) / 255.0;
+			this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;
+			return this;
+		};
+		Color.prototype.add = function (r, g, b, a) {
+			this.r += r;
+			this.g += g;
+			this.b += b;
+			this.a += a;
+			this.clamp();
+			return this;
+		};
+		Color.prototype.clamp = function () {
+			if (this.r < 0)
+				this.r = 0;
+			else if (this.r > 1)
+				this.r = 1;
+			if (this.g < 0)
+				this.g = 0;
+			else if (this.g > 1)
+				this.g = 1;
+			if (this.b < 0)
+				this.b = 0;
+			else if (this.b > 1)
+				this.b = 1;
+			if (this.a < 0)
+				this.a = 0;
+			else if (this.a > 1)
+				this.a = 1;
+			return this;
+		};
+		Color.WHITE = new Color(1, 1, 1, 1);
+		Color.RED = new Color(1, 0, 0, 1);
+		Color.GREEN = new Color(0, 1, 0, 1);
+		Color.BLUE = new Color(0, 0, 1, 1);
+		Color.MAGENTA = new Color(1, 0, 1, 1);
+		return Color;
+	}());
+	spine.Color = Color;
+	var MathUtils = (function () {
+		function MathUtils() {
 		}
 		}
-		MeshAttachment.prototype.updateUVs = function () {
-			var u = 0, v = 0, width = 0, height = 0;
-			if (this.region == null) {
-				u = v = 0;
-				width = height = 1;
+		MathUtils.clamp = function (value, min, max) {
+			if (value < min)
+				return min;
+			if (value > max)
+				return max;
+			return value;
+		};
+		MathUtils.cosDeg = function (degrees) {
+			return Math.cos(degrees * MathUtils.degRad);
+		};
+		MathUtils.sinDeg = function (degrees) {
+			return Math.sin(degrees * MathUtils.degRad);
+		};
+		MathUtils.signum = function (value) {
+			return value > 0 ? 1 : value < 0 ? -1 : 0;
+		};
+		MathUtils.toInt = function (x) {
+			return x > 0 ? Math.floor(x) : Math.ceil(x);
+		};
+		MathUtils.cbrt = function (x) {
+			var y = Math.pow(Math.abs(x), 1 / 3);
+			return x < 0 ? -y : y;
+		};
+		MathUtils.PI = 3.1415927;
+		MathUtils.PI2 = MathUtils.PI * 2;
+		MathUtils.radiansToDegrees = 180 / MathUtils.PI;
+		MathUtils.radDeg = MathUtils.radiansToDegrees;
+		MathUtils.degreesToRadians = MathUtils.PI / 180;
+		MathUtils.degRad = MathUtils.degreesToRadians;
+		return MathUtils;
+	}());
+	spine.MathUtils = MathUtils;
+	var Utils = (function () {
+		function Utils() {
+		}
+		Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {
+			for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {
+				dest[j] = source[i];
+			}
+		};
+		Utils.setArraySize = function (array, size, value) {
+			if (value === void 0) { value = 0; }
+			var oldSize = array.length;
+			if (oldSize == size)
+				return array;
+			array.length = size;
+			if (oldSize < size) {
+				for (var i = oldSize; i < size; i++)
+					array[i] = value;
+			}
+			return array;
+		};
+		Utils.ensureArrayCapacity = function (array, size, value) {
+			if (value === void 0) { value = 0; }
+			if (array.length >= size)
+				return array;
+			return Utils.setArraySize(array, size, value);
+		};
+		Utils.newArray = function (size, defaultValue) {
+			var array = new Array(size);
+			for (var i = 0; i < size; i++)
+				array[i] = defaultValue;
+			return array;
+		};
+		Utils.newFloatArray = function (size) {
+			if (Utils.SUPPORTS_TYPED_ARRAYS) {
+				return new Float32Array(size);
 			}
 			}
 			else {
 			else {
-				u = this.region.u;
-				v = this.region.v;
-				width = this.region.u2 - u;
-				height = this.region.v2 - v;
+				var array = new Array(size);
+				for (var i = 0; i < array.length; i++)
+					array[i] = 0;
+				return array;
 			}
 			}
-			var regionUVs = this.regionUVs;
-			if (this.uvs == null || this.uvs.length != regionUVs.length)
-				this.uvs = spine.Utils.newFloatArray(regionUVs.length);
-			var uvs = this.uvs;
-			if (this.region.rotate) {
-				for (var i = 0, n = uvs.length; i < n; i += 2) {
-					uvs[i] = u + regionUVs[i + 1] * width;
-					uvs[i + 1] = v + height - regionUVs[i] * height;
-				}
+		};
+		Utils.newShortArray = function (size) {
+			if (Utils.SUPPORTS_TYPED_ARRAYS) {
+				return new Int16Array(size);
+			}
+			else {
+				var array = new Array(size);
+				for (var i = 0; i < array.length; i++)
+					array[i] = 0;
+				return array;
 			}
 			}
-			else {
-				for (var i = 0, n = uvs.length; i < n; i += 2) {
-					uvs[i] = u + regionUVs[i] * width;
-					uvs[i + 1] = v + regionUVs[i + 1] * height;
-				}
+		};
+		Utils.toFloatArray = function (array) {
+			return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;
+		};
+		Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== "undefined";
+		return Utils;
+	}());
+	spine.Utils = Utils;
+	var DebugUtils = (function () {
+		function DebugUtils() {
+		}
+		DebugUtils.logBones = function (skeleton) {
+			for (var i = 0; i < skeleton.bones.length; i++) {
+				var bone = skeleton.bones[i];
+				console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY);
 			}
 			}
 		};
 		};
-		MeshAttachment.prototype.applyDeform = function (sourceAttachment) {
-			return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);
+		return DebugUtils;
+	}());
+	spine.DebugUtils = DebugUtils;
+	var Pool = (function () {
+		function Pool(instantiator) {
+			this.items = new Array();
+			this.instantiator = instantiator;
+		}
+		Pool.prototype.obtain = function () {
+			return this.items.length > 0 ? this.items.pop() : this.instantiator();
 		};
 		};
-		MeshAttachment.prototype.getParentMesh = function () {
-			return this.parentMesh;
+		Pool.prototype.free = function (item) {
+			if (item.reset)
+				item.reset();
+			this.items.push(item);
 		};
 		};
-		MeshAttachment.prototype.setParentMesh = function (parentMesh) {
-			this.parentMesh = parentMesh;
-			if (parentMesh != null) {
-				this.bones = parentMesh.bones;
-				this.vertices = parentMesh.vertices;
-				this.worldVerticesLength = parentMesh.worldVerticesLength;
-				this.regionUVs = parentMesh.regionUVs;
-				this.triangles = parentMesh.triangles;
-				this.hullLength = parentMesh.hullLength;
-				this.worldVerticesLength = parentMesh.worldVerticesLength;
+		Pool.prototype.freeAll = function (items) {
+			for (var i = 0; i < items.length; i++) {
+				if (items[i].reset)
+					items[i].reset();
+				this.items[i] = items[i];
 			}
 			}
 		};
 		};
-		return MeshAttachment;
-	}(spine.VertexAttachment));
-	spine.MeshAttachment = MeshAttachment;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var PathAttachment = (function (_super) {
-		__extends(PathAttachment, _super);
-		function PathAttachment(name) {
-			var _this = _super.call(this, name) || this;
-			_this.closed = false;
-			_this.constantSpeed = false;
-			_this.color = new spine.Color(1, 1, 1, 1);
-			return _this;
-		}
-		return PathAttachment;
-	}(spine.VertexAttachment));
-	spine.PathAttachment = PathAttachment;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var PointAttachment = (function (_super) {
-		__extends(PointAttachment, _super);
-		function PointAttachment(name) {
-			var _this = _super.call(this, name) || this;
-			_this.color = new spine.Color(0.38, 0.94, 0, 1);
-			return _this;
+		Pool.prototype.clear = function () {
+			this.items.length = 0;
+		};
+		return Pool;
+	}());
+	spine.Pool = Pool;
+	var Vector2 = (function () {
+		function Vector2(x, y) {
+			if (x === void 0) { x = 0; }
+			if (y === void 0) { y = 0; }
+			this.x = x;
+			this.y = y;
 		}
 		}
-		PointAttachment.prototype.computeWorldPosition = function (bone, point) {
-			point.x = this.x * bone.a + this.y * bone.b + bone.worldX;
-			point.y = this.x * bone.c + this.y * bone.d + bone.worldY;
-			return point;
+		Vector2.prototype.set = function (x, y) {
+			this.x = x;
+			this.y = y;
+			return this;
 		};
 		};
-		PointAttachment.prototype.computeWorldRotation = function (bone) {
-			var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation);
-			var x = cos * bone.a + sin * bone.b;
-			var y = cos * bone.c + sin * bone.d;
-			return Math.atan2(y, x) * spine.MathUtils.radDeg;
+		Vector2.prototype.length = function () {
+			var x = this.x;
+			var y = this.y;
+			return Math.sqrt(x * x + y * y);
 		};
 		};
-		return PointAttachment;
-	}(spine.VertexAttachment));
-	spine.PointAttachment = PointAttachment;
-})(spine || (spine = {}));
-var spine;
-(function (spine) {
-	var RegionAttachment = (function (_super) {
-		__extends(RegionAttachment, _super);
-		function RegionAttachment(name) {
-			var _this = _super.call(this, name) || this;
-			_this.x = 0;
-			_this.y = 0;
-			_this.scaleX = 1;
-			_this.scaleY = 1;
-			_this.rotation = 0;
-			_this.width = 0;
-			_this.height = 0;
-			_this.color = new spine.Color(1, 1, 1, 1);
-			_this.offset = spine.Utils.newFloatArray(8);
-			_this.uvs = spine.Utils.newFloatArray(8);
-			_this.tempColor = new spine.Color(1, 1, 1, 1);
-			return _this;
+		Vector2.prototype.normalize = function () {
+			var len = this.length();
+			if (len != 0) {
+				this.x /= len;
+				this.y /= len;
+			}
+			return this;
+		};
+		return Vector2;
+	}());
+	spine.Vector2 = Vector2;
+	var TimeKeeper = (function () {
+		function TimeKeeper() {
+			this.maxDelta = 0.064;
+			this.framesPerSecond = 0;
+			this.delta = 0;
+			this.totalTime = 0;
+			this.lastTime = Date.now() / 1000;
+			this.frameCount = 0;
+			this.frameTime = 0;
 		}
 		}
-		RegionAttachment.prototype.updateOffset = function () {
-			var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
-			var regionScaleY = this.height / this.region.originalHeight * this.scaleY;
-			var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;
-			var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;
-			var localX2 = localX + this.region.width * regionScaleX;
-			var localY2 = localY + this.region.height * regionScaleY;
-			var radians = this.rotation * Math.PI / 180;
-			var cos = Math.cos(radians);
-			var sin = Math.sin(radians);
-			var localXCos = localX * cos + this.x;
-			var localXSin = localX * sin;
-			var localYCos = localY * cos + this.y;
-			var localYSin = localY * sin;
-			var localX2Cos = localX2 * cos + this.x;
-			var localX2Sin = localX2 * sin;
-			var localY2Cos = localY2 * cos + this.y;
-			var localY2Sin = localY2 * sin;
-			var offset = this.offset;
-			offset[RegionAttachment.OX1] = localXCos - localYSin;
-			offset[RegionAttachment.OY1] = localYCos + localXSin;
-			offset[RegionAttachment.OX2] = localXCos - localY2Sin;
-			offset[RegionAttachment.OY2] = localY2Cos + localXSin;
-			offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;
-			offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;
-			offset[RegionAttachment.OX4] = localX2Cos - localYSin;
-			offset[RegionAttachment.OY4] = localYCos + localX2Sin;
+		TimeKeeper.prototype.update = function () {
+			var now = Date.now() / 1000;
+			this.delta = now - this.lastTime;
+			this.frameTime += this.delta;
+			this.totalTime += this.delta;
+			if (this.delta > this.maxDelta)
+				this.delta = this.maxDelta;
+			this.lastTime = now;
+			this.frameCount++;
+			if (this.frameTime > 1) {
+				this.framesPerSecond = this.frameCount / this.frameTime;
+				this.frameTime = 0;
+				this.frameCount = 0;
+			}
 		};
 		};
-		RegionAttachment.prototype.setRegion = function (region) {
-			this.region = region;
-			var uvs = this.uvs;
-			if (region.rotate) {
-				uvs[2] = region.u;
-				uvs[3] = region.v2;
-				uvs[4] = region.u;
-				uvs[5] = region.v;
-				uvs[6] = region.u2;
-				uvs[7] = region.v;
-				uvs[0] = region.u2;
-				uvs[1] = region.v2;
+		return TimeKeeper;
+	}());
+	spine.TimeKeeper = TimeKeeper;
+	var WindowedMean = (function () {
+		function WindowedMean(windowSize) {
+			if (windowSize === void 0) { windowSize = 32; }
+			this.addedValues = 0;
+			this.lastValue = 0;
+			this.mean = 0;
+			this.dirty = true;
+			this.values = new Array(windowSize);
+		}
+		WindowedMean.prototype.hasEnoughData = function () {
+			return this.addedValues >= this.values.length;
+		};
+		WindowedMean.prototype.addValue = function (value) {
+			if (this.addedValues < this.values.length)
+				this.addedValues++;
+			this.values[this.lastValue++] = value;
+			if (this.lastValue > this.values.length - 1)
+				this.lastValue = 0;
+			this.dirty = true;
+		};
+		WindowedMean.prototype.getMean = function () {
+			if (this.hasEnoughData()) {
+				if (this.dirty) {
+					var mean = 0;
+					for (var i = 0; i < this.values.length; i++) {
+						mean += this.values[i];
+					}
+					this.mean = mean / this.values.length;
+					this.dirty = false;
+				}
+				return this.mean;
 			}
 			}
 			else {
 			else {
-				uvs[0] = region.u;
-				uvs[1] = region.v2;
-				uvs[2] = region.u;
-				uvs[3] = region.v;
-				uvs[4] = region.u2;
-				uvs[5] = region.v;
-				uvs[6] = region.u2;
-				uvs[7] = region.v2;
+				return 0;
 			}
 			}
 		};
 		};
-		RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {
-			var vertexOffset = this.offset;
-			var x = bone.worldX, y = bone.worldY;
-			var a = bone.a, b = bone.b, c = bone.c, d = bone.d;
-			var offsetX = 0, offsetY = 0;
-			offsetX = vertexOffset[RegionAttachment.OX1];
-			offsetY = vertexOffset[RegionAttachment.OY1];
-			worldVertices[offset] = offsetX * a + offsetY * b + x;
-			worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
-			offset += stride;
-			offsetX = vertexOffset[RegionAttachment.OX2];
-			offsetY = vertexOffset[RegionAttachment.OY2];
-			worldVertices[offset] = offsetX * a + offsetY * b + x;
-			worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
-			offset += stride;
-			offsetX = vertexOffset[RegionAttachment.OX3];
-			offsetY = vertexOffset[RegionAttachment.OY3];
-			worldVertices[offset] = offsetX * a + offsetY * b + x;
-			worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
-			offset += stride;
-			offsetX = vertexOffset[RegionAttachment.OX4];
-			offsetY = vertexOffset[RegionAttachment.OY4];
-			worldVertices[offset] = offsetX * a + offsetY * b + x;
-			worldVertices[offset + 1] = offsetX * c + offsetY * d + y;
-		};
-		return RegionAttachment;
-	}(spine.Attachment));
-	RegionAttachment.OX1 = 0;
-	RegionAttachment.OY1 = 1;
-	RegionAttachment.OX2 = 2;
-	RegionAttachment.OY2 = 3;
-	RegionAttachment.OX3 = 4;
-	RegionAttachment.OY3 = 5;
-	RegionAttachment.OX4 = 6;
-	RegionAttachment.OY4 = 7;
-	RegionAttachment.X1 = 0;
-	RegionAttachment.Y1 = 1;
-	RegionAttachment.C1R = 2;
-	RegionAttachment.C1G = 3;
-	RegionAttachment.C1B = 4;
-	RegionAttachment.C1A = 5;
-	RegionAttachment.U1 = 6;
-	RegionAttachment.V1 = 7;
-	RegionAttachment.X2 = 8;
-	RegionAttachment.Y2 = 9;
-	RegionAttachment.C2R = 10;
-	RegionAttachment.C2G = 11;
-	RegionAttachment.C2B = 12;
-	RegionAttachment.C2A = 13;
-	RegionAttachment.U2 = 14;
-	RegionAttachment.V2 = 15;
-	RegionAttachment.X3 = 16;
-	RegionAttachment.Y3 = 17;
-	RegionAttachment.C3R = 18;
-	RegionAttachment.C3G = 19;
-	RegionAttachment.C3B = 20;
-	RegionAttachment.C3A = 21;
-	RegionAttachment.U3 = 22;
-	RegionAttachment.V3 = 23;
-	RegionAttachment.X4 = 24;
-	RegionAttachment.Y4 = 25;
-	RegionAttachment.C4R = 26;
-	RegionAttachment.C4G = 27;
-	RegionAttachment.C4B = 28;
-	RegionAttachment.C4A = 29;
-	RegionAttachment.U4 = 30;
-	RegionAttachment.V4 = 31;
-	spine.RegionAttachment = RegionAttachment;
+		return WindowedMean;
+	}());
+	spine.WindowedMean = WindowedMean;
 })(spine || (spine = {}));
 })(spine || (spine = {}));
 //# sourceMappingURL=spine-core.js.map
 //# sourceMappingURL=spine-core.js.map

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
spine-ts/build/spine-core.js.map


+ 149 - 149
spine-ts/build/spine-threejs.d.ts

@@ -245,7 +245,7 @@ declare module spine {
 		constructor(data: AnimationStateData);
 		constructor(data: AnimationStateData);
 		update(delta: number): void;
 		update(delta: number): void;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
-		apply(skeleton: Skeleton): void;
+		apply(skeleton: Skeleton): boolean;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
@@ -390,6 +390,154 @@ declare module spine {
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+		newPointAttachment(skin: Skin, name: string): PointAttachment;
+		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+		Point = 5,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class ClippingAttachment extends VertexAttachment {
+		endSlot: SlotData;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class PointAttachment extends VertexAttachment {
+		x: number;
+		y: number;
+		rotation: number;
+		color: Color;
+		constructor(name: string);
+		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
+		computeWorldRotation(bone: Bone): number;
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		updateOffset(): void;
+		setRegion(region: TextureRegion): void;
+		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -1010,154 +1158,6 @@ declare module spine {
 		getMean(): number;
 		getMean(): number;
 	}
 	}
 }
 }
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-		newPointAttachment(skin: Skin, name: string): PointAttachment;
-		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-		Point = 5,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class ClippingAttachment extends VertexAttachment {
-		endSlot: SlotData;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class PointAttachment extends VertexAttachment {
-		x: number;
-		y: number;
-		rotation: number;
-		color: Color;
-		constructor(name: string);
-		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
-		computeWorldRotation(bone: Bone): number;
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		updateOffset(): void;
-		setRegion(region: TextureRegion): void;
-		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-	}
-}
 declare module spine.threejs {
 declare module spine.threejs {
 	class AssetManager extends spine.AssetManager {
 	class AssetManager extends spine.AssetManager {
 		constructor(pathPrefix?: string);
 		constructor(pathPrefix?: string);

Diff do ficheiro suprimidas por serem muito extensas
+ 4007 - 4022
spine-ts/build/spine-threejs.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
spine-ts/build/spine-threejs.js.map


+ 1475 - 1475
spine-ts/build/spine-webgl.d.ts

@@ -1,1585 +1,1585 @@
 declare module spine {
 declare module spine {
-    class Animation {
-        name: string;
-        timelines: Array<Timeline>;
-        duration: number;
-        constructor(name: string, timelines: Array<Timeline>, duration: number);
-        apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-        static binarySearch(values: ArrayLike<number>, target: number, step?: number): number;
-        static linearSearch(values: ArrayLike<number>, target: number, step: number): number;
-    }
-    interface Timeline {
-        apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-        getPropertyId(): number;
-    }
-    enum TimelineType {
-        rotate = 0,
-        translate = 1,
-        scale = 2,
-        shear = 3,
-        attachment = 4,
-        color = 5,
-        deform = 6,
-        event = 7,
-        drawOrder = 8,
-        ikConstraint = 9,
-        transformConstraint = 10,
-        pathConstraintPosition = 11,
-        pathConstraintSpacing = 12,
-        pathConstraintMix = 13,
-        twoColor = 14,
-    }
-    abstract class CurveTimeline implements Timeline {
-        static LINEAR: number;
-        static STEPPED: number;
-        static BEZIER: number;
-        static BEZIER_SIZE: number;
-        private curves;
-        abstract getPropertyId(): number;
-        constructor(frameCount: number);
-        getFrameCount(): number;
-        setLinear(frameIndex: number): void;
-        setStepped(frameIndex: number): void;
-        getCurveType(frameIndex: number): number;
-        setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void;
-        getCurvePercent(frameIndex: number, percent: number): number;
-        abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class RotateTimeline extends CurveTimeline {
-        static ENTRIES: number;
-        static PREV_TIME: number;
-        static PREV_ROTATION: number;
-        static ROTATION: number;
-        boneIndex: number;
-        frames: ArrayLike<number>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, degrees: number): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class TranslateTimeline extends CurveTimeline {
-        static ENTRIES: number;
-        static PREV_TIME: number;
-        static PREV_X: number;
-        static PREV_Y: number;
-        static X: number;
-        static Y: number;
-        boneIndex: number;
-        frames: ArrayLike<number>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, x: number, y: number): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class ScaleTimeline extends TranslateTimeline {
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class ShearTimeline extends TranslateTimeline {
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class ColorTimeline extends CurveTimeline {
-        static ENTRIES: number;
-        static PREV_TIME: number;
-        static PREV_R: number;
-        static PREV_G: number;
-        static PREV_B: number;
-        static PREV_A: number;
-        static R: number;
-        static G: number;
-        static B: number;
-        static A: number;
-        slotIndex: number;
-        frames: ArrayLike<number>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class TwoColorTimeline extends CurveTimeline {
-        static ENTRIES: number;
-        static PREV_TIME: number;
-        static PREV_R: number;
-        static PREV_G: number;
-        static PREV_B: number;
-        static PREV_A: number;
-        static PREV_R2: number;
-        static PREV_G2: number;
-        static PREV_B2: number;
-        static R: number;
-        static G: number;
-        static B: number;
-        static A: number;
-        static R2: number;
-        static G2: number;
-        static B2: number;
-        slotIndex: number;
-        frames: ArrayLike<number>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class AttachmentTimeline implements Timeline {
-        slotIndex: number;
-        frames: ArrayLike<number>;
-        attachmentNames: Array<string>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        getFrameCount(): number;
-        setFrame(frameIndex: number, time: number, attachmentName: string): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class DeformTimeline extends CurveTimeline {
-        slotIndex: number;
-        attachment: VertexAttachment;
-        frames: ArrayLike<number>;
-        frameVertices: Array<ArrayLike<number>>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, vertices: ArrayLike<number>): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class EventTimeline implements Timeline {
-        frames: ArrayLike<number>;
-        events: Array<Event>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        getFrameCount(): number;
-        setFrame(frameIndex: number, event: Event): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class DrawOrderTimeline implements Timeline {
-        frames: ArrayLike<number>;
-        drawOrders: Array<Array<number>>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        getFrameCount(): number;
-        setFrame(frameIndex: number, time: number, drawOrder: Array<number>): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class IkConstraintTimeline extends CurveTimeline {
-        static ENTRIES: number;
-        static PREV_TIME: number;
-        static PREV_MIX: number;
-        static PREV_BEND_DIRECTION: number;
-        static MIX: number;
-        static BEND_DIRECTION: number;
-        ikConstraintIndex: number;
-        frames: ArrayLike<number>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, mix: number, bendDirection: number): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class TransformConstraintTimeline extends CurveTimeline {
-        static ENTRIES: number;
-        static PREV_TIME: number;
-        static PREV_ROTATE: number;
-        static PREV_TRANSLATE: number;
-        static PREV_SCALE: number;
-        static PREV_SHEAR: number;
-        static ROTATE: number;
-        static TRANSLATE: number;
-        static SCALE: number;
-        static SHEAR: number;
-        transformConstraintIndex: number;
-        frames: ArrayLike<number>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class PathConstraintPositionTimeline extends CurveTimeline {
-        static ENTRIES: number;
-        static PREV_TIME: number;
-        static PREV_VALUE: number;
-        static VALUE: number;
-        pathConstraintIndex: number;
-        frames: ArrayLike<number>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, value: number): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline {
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
-    class PathConstraintMixTimeline extends CurveTimeline {
-        static ENTRIES: number;
-        static PREV_TIME: number;
-        static PREV_ROTATE: number;
-        static PREV_TRANSLATE: number;
-        static ROTATE: number;
-        static TRANSLATE: number;
-        pathConstraintIndex: number;
-        frames: ArrayLike<number>;
-        constructor(frameCount: number);
-        getPropertyId(): number;
-        setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number): void;
-        apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
-    }
+	class Animation {
+		name: string;
+		timelines: Array<Timeline>;
+		duration: number;
+		constructor(name: string, timelines: Array<Timeline>, duration: number);
+		apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+		static binarySearch(values: ArrayLike<number>, target: number, step?: number): number;
+		static linearSearch(values: ArrayLike<number>, target: number, step: number): number;
+	}
+	interface Timeline {
+		apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+		getPropertyId(): number;
+	}
+	enum TimelineType {
+		rotate = 0,
+		translate = 1,
+		scale = 2,
+		shear = 3,
+		attachment = 4,
+		color = 5,
+		deform = 6,
+		event = 7,
+		drawOrder = 8,
+		ikConstraint = 9,
+		transformConstraint = 10,
+		pathConstraintPosition = 11,
+		pathConstraintSpacing = 12,
+		pathConstraintMix = 13,
+		twoColor = 14,
+	}
+	abstract class CurveTimeline implements Timeline {
+		static LINEAR: number;
+		static STEPPED: number;
+		static BEZIER: number;
+		static BEZIER_SIZE: number;
+		private curves;
+		abstract getPropertyId(): number;
+		constructor(frameCount: number);
+		getFrameCount(): number;
+		setLinear(frameIndex: number): void;
+		setStepped(frameIndex: number): void;
+		getCurveType(frameIndex: number): number;
+		setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void;
+		getCurvePercent(frameIndex: number, percent: number): number;
+		abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class RotateTimeline extends CurveTimeline {
+		static ENTRIES: number;
+		static PREV_TIME: number;
+		static PREV_ROTATION: number;
+		static ROTATION: number;
+		boneIndex: number;
+		frames: ArrayLike<number>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, degrees: number): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class TranslateTimeline extends CurveTimeline {
+		static ENTRIES: number;
+		static PREV_TIME: number;
+		static PREV_X: number;
+		static PREV_Y: number;
+		static X: number;
+		static Y: number;
+		boneIndex: number;
+		frames: ArrayLike<number>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, x: number, y: number): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class ScaleTimeline extends TranslateTimeline {
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class ShearTimeline extends TranslateTimeline {
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class ColorTimeline extends CurveTimeline {
+		static ENTRIES: number;
+		static PREV_TIME: number;
+		static PREV_R: number;
+		static PREV_G: number;
+		static PREV_B: number;
+		static PREV_A: number;
+		static R: number;
+		static G: number;
+		static B: number;
+		static A: number;
+		slotIndex: number;
+		frames: ArrayLike<number>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class TwoColorTimeline extends CurveTimeline {
+		static ENTRIES: number;
+		static PREV_TIME: number;
+		static PREV_R: number;
+		static PREV_G: number;
+		static PREV_B: number;
+		static PREV_A: number;
+		static PREV_R2: number;
+		static PREV_G2: number;
+		static PREV_B2: number;
+		static R: number;
+		static G: number;
+		static B: number;
+		static A: number;
+		static R2: number;
+		static G2: number;
+		static B2: number;
+		slotIndex: number;
+		frames: ArrayLike<number>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class AttachmentTimeline implements Timeline {
+		slotIndex: number;
+		frames: ArrayLike<number>;
+		attachmentNames: Array<string>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		getFrameCount(): number;
+		setFrame(frameIndex: number, time: number, attachmentName: string): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class DeformTimeline extends CurveTimeline {
+		slotIndex: number;
+		attachment: VertexAttachment;
+		frames: ArrayLike<number>;
+		frameVertices: Array<ArrayLike<number>>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, vertices: ArrayLike<number>): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class EventTimeline implements Timeline {
+		frames: ArrayLike<number>;
+		events: Array<Event>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		getFrameCount(): number;
+		setFrame(frameIndex: number, event: Event): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class DrawOrderTimeline implements Timeline {
+		frames: ArrayLike<number>;
+		drawOrders: Array<Array<number>>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		getFrameCount(): number;
+		setFrame(frameIndex: number, time: number, drawOrder: Array<number>): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class IkConstraintTimeline extends CurveTimeline {
+		static ENTRIES: number;
+		static PREV_TIME: number;
+		static PREV_MIX: number;
+		static PREV_BEND_DIRECTION: number;
+		static MIX: number;
+		static BEND_DIRECTION: number;
+		ikConstraintIndex: number;
+		frames: ArrayLike<number>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, mix: number, bendDirection: number): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class TransformConstraintTimeline extends CurveTimeline {
+		static ENTRIES: number;
+		static PREV_TIME: number;
+		static PREV_ROTATE: number;
+		static PREV_TRANSLATE: number;
+		static PREV_SCALE: number;
+		static PREV_SHEAR: number;
+		static ROTATE: number;
+		static TRANSLATE: number;
+		static SCALE: number;
+		static SHEAR: number;
+		transformConstraintIndex: number;
+		frames: ArrayLike<number>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class PathConstraintPositionTimeline extends CurveTimeline {
+		static ENTRIES: number;
+		static PREV_TIME: number;
+		static PREV_VALUE: number;
+		static VALUE: number;
+		pathConstraintIndex: number;
+		frames: ArrayLike<number>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, value: number): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline {
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
+	class PathConstraintMixTimeline extends CurveTimeline {
+		static ENTRIES: number;
+		static PREV_TIME: number;
+		static PREV_ROTATE: number;
+		static PREV_TRANSLATE: number;
+		static ROTATE: number;
+		static TRANSLATE: number;
+		pathConstraintIndex: number;
+		frames: ArrayLike<number>;
+		constructor(frameCount: number);
+		getPropertyId(): number;
+		setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number): void;
+		apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, setupPose: boolean, mixingOut: boolean): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class AnimationState {
-        static emptyAnimation: Animation;
-        static SUBSEQUENT: number;
-        static FIRST: number;
-        static DIP: number;
-        static DIP_MIX: number;
-        data: AnimationStateData;
-        tracks: TrackEntry[];
-        events: Event[];
-        listeners: AnimationStateListener2[];
-        queue: EventQueue;
-        propertyIDs: IntSet;
-        mixingTo: TrackEntry[];
-        animationsChanged: boolean;
-        timeScale: number;
-        trackEntryPool: Pool<TrackEntry>;
-        constructor(data: AnimationStateData);
-        update(delta: number): void;
-        updateMixingFrom(to: TrackEntry, delta: number): boolean;
-        apply(skeleton: Skeleton): void;
-        applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
-        applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
-        queueEvents(entry: TrackEntry, animationTime: number): void;
-        clearTracks(): void;
-        clearTrack(trackIndex: number): void;
-        setCurrent(index: number, current: TrackEntry, interrupt: boolean): void;
-        setAnimation(trackIndex: number, animationName: string, loop: boolean): TrackEntry;
-        setAnimationWith(trackIndex: number, animation: Animation, loop: boolean): TrackEntry;
-        addAnimation(trackIndex: number, animationName: string, loop: boolean, delay: number): TrackEntry;
-        addAnimationWith(trackIndex: number, animation: Animation, loop: boolean, delay: number): TrackEntry;
-        setEmptyAnimation(trackIndex: number, mixDuration: number): TrackEntry;
-        addEmptyAnimation(trackIndex: number, mixDuration: number, delay: number): TrackEntry;
-        setEmptyAnimations(mixDuration: number): void;
-        expandToIndex(index: number): TrackEntry;
-        trackEntry(trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry): TrackEntry;
-        disposeNext(entry: TrackEntry): void;
-        _animationsChanged(): void;
-        getCurrent(trackIndex: number): TrackEntry;
-        addListener(listener: AnimationStateListener2): void;
-        removeListener(listener: AnimationStateListener2): void;
-        clearListeners(): void;
-        clearListenerNotifications(): void;
-    }
-    class TrackEntry {
-        animation: Animation;
-        next: TrackEntry;
-        mixingFrom: TrackEntry;
-        listener: AnimationStateListener2;
-        trackIndex: number;
-        loop: boolean;
-        eventThreshold: number;
-        attachmentThreshold: number;
-        drawOrderThreshold: number;
-        animationStart: number;
-        animationEnd: number;
-        animationLast: number;
-        nextAnimationLast: number;
-        delay: number;
-        trackTime: number;
-        trackLast: number;
-        nextTrackLast: number;
-        trackEnd: number;
-        timeScale: number;
-        alpha: number;
-        mixTime: number;
-        mixDuration: number;
-        interruptAlpha: number;
-        totalAlpha: number;
-        timelineData: number[];
-        timelineDipMix: TrackEntry[];
-        timelinesRotation: number[];
-        reset(): void;
-        setTimelineData(to: TrackEntry, mixingToArray: Array<TrackEntry>, propertyIDs: IntSet): TrackEntry;
-        hasTimeline(id: number): boolean;
-        getAnimationTime(): number;
-        setAnimationLast(animationLast: number): void;
-        isComplete(): boolean;
-        resetRotationDirections(): void;
-    }
-    class EventQueue {
-        objects: Array<any>;
-        drainDisabled: boolean;
-        animState: AnimationState;
-        constructor(animState: AnimationState);
-        start(entry: TrackEntry): void;
-        interrupt(entry: TrackEntry): void;
-        end(entry: TrackEntry): void;
-        dispose(entry: TrackEntry): void;
-        complete(entry: TrackEntry): void;
-        event(entry: TrackEntry, event: Event): void;
-        drain(): void;
-        clear(): void;
-    }
-    enum EventType {
-        start = 0,
-        interrupt = 1,
-        end = 2,
-        dispose = 3,
-        complete = 4,
-        event = 5,
-    }
-    interface AnimationStateListener2 {
-        start(entry: TrackEntry): void;
-        interrupt(entry: TrackEntry): void;
-        end(entry: TrackEntry): void;
-        dispose(entry: TrackEntry): void;
-        complete(entry: TrackEntry): void;
-        event(entry: TrackEntry, event: Event): void;
-    }
-    abstract class AnimationStateAdapter2 implements AnimationStateListener2 {
-        start(entry: TrackEntry): void;
-        interrupt(entry: TrackEntry): void;
-        end(entry: TrackEntry): void;
-        dispose(entry: TrackEntry): void;
-        complete(entry: TrackEntry): void;
-        event(entry: TrackEntry, event: Event): void;
-    }
+	class AnimationState {
+		static emptyAnimation: Animation;
+		static SUBSEQUENT: number;
+		static FIRST: number;
+		static DIP: number;
+		static DIP_MIX: number;
+		data: AnimationStateData;
+		tracks: TrackEntry[];
+		events: Event[];
+		listeners: AnimationStateListener2[];
+		queue: EventQueue;
+		propertyIDs: IntSet;
+		mixingTo: TrackEntry[];
+		animationsChanged: boolean;
+		timeScale: number;
+		trackEntryPool: Pool<TrackEntry>;
+		constructor(data: AnimationStateData);
+		update(delta: number): void;
+		updateMixingFrom(to: TrackEntry, delta: number): boolean;
+		apply(skeleton: Skeleton): boolean;
+		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
+		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
+		queueEvents(entry: TrackEntry, animationTime: number): void;
+		clearTracks(): void;
+		clearTrack(trackIndex: number): void;
+		setCurrent(index: number, current: TrackEntry, interrupt: boolean): void;
+		setAnimation(trackIndex: number, animationName: string, loop: boolean): TrackEntry;
+		setAnimationWith(trackIndex: number, animation: Animation, loop: boolean): TrackEntry;
+		addAnimation(trackIndex: number, animationName: string, loop: boolean, delay: number): TrackEntry;
+		addAnimationWith(trackIndex: number, animation: Animation, loop: boolean, delay: number): TrackEntry;
+		setEmptyAnimation(trackIndex: number, mixDuration: number): TrackEntry;
+		addEmptyAnimation(trackIndex: number, mixDuration: number, delay: number): TrackEntry;
+		setEmptyAnimations(mixDuration: number): void;
+		expandToIndex(index: number): TrackEntry;
+		trackEntry(trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry): TrackEntry;
+		disposeNext(entry: TrackEntry): void;
+		_animationsChanged(): void;
+		getCurrent(trackIndex: number): TrackEntry;
+		addListener(listener: AnimationStateListener2): void;
+		removeListener(listener: AnimationStateListener2): void;
+		clearListeners(): void;
+		clearListenerNotifications(): void;
+	}
+	class TrackEntry {
+		animation: Animation;
+		next: TrackEntry;
+		mixingFrom: TrackEntry;
+		listener: AnimationStateListener2;
+		trackIndex: number;
+		loop: boolean;
+		eventThreshold: number;
+		attachmentThreshold: number;
+		drawOrderThreshold: number;
+		animationStart: number;
+		animationEnd: number;
+		animationLast: number;
+		nextAnimationLast: number;
+		delay: number;
+		trackTime: number;
+		trackLast: number;
+		nextTrackLast: number;
+		trackEnd: number;
+		timeScale: number;
+		alpha: number;
+		mixTime: number;
+		mixDuration: number;
+		interruptAlpha: number;
+		totalAlpha: number;
+		timelineData: number[];
+		timelineDipMix: TrackEntry[];
+		timelinesRotation: number[];
+		reset(): void;
+		setTimelineData(to: TrackEntry, mixingToArray: Array<TrackEntry>, propertyIDs: IntSet): TrackEntry;
+		hasTimeline(id: number): boolean;
+		getAnimationTime(): number;
+		setAnimationLast(animationLast: number): void;
+		isComplete(): boolean;
+		resetRotationDirections(): void;
+	}
+	class EventQueue {
+		objects: Array<any>;
+		drainDisabled: boolean;
+		animState: AnimationState;
+		constructor(animState: AnimationState);
+		start(entry: TrackEntry): void;
+		interrupt(entry: TrackEntry): void;
+		end(entry: TrackEntry): void;
+		dispose(entry: TrackEntry): void;
+		complete(entry: TrackEntry): void;
+		event(entry: TrackEntry, event: Event): void;
+		drain(): void;
+		clear(): void;
+	}
+	enum EventType {
+		start = 0,
+		interrupt = 1,
+		end = 2,
+		dispose = 3,
+		complete = 4,
+		event = 5,
+	}
+	interface AnimationStateListener2 {
+		start(entry: TrackEntry): void;
+		interrupt(entry: TrackEntry): void;
+		end(entry: TrackEntry): void;
+		dispose(entry: TrackEntry): void;
+		complete(entry: TrackEntry): void;
+		event(entry: TrackEntry, event: Event): void;
+	}
+	abstract class AnimationStateAdapter2 implements AnimationStateListener2 {
+		start(entry: TrackEntry): void;
+		interrupt(entry: TrackEntry): void;
+		end(entry: TrackEntry): void;
+		dispose(entry: TrackEntry): void;
+		complete(entry: TrackEntry): void;
+		event(entry: TrackEntry, event: Event): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class AnimationStateData {
-        skeletonData: SkeletonData;
-        animationToMixTime: Map<number>;
-        defaultMix: number;
-        constructor(skeletonData: SkeletonData);
-        setMix(fromName: string, toName: string, duration: number): void;
-        setMixWith(from: Animation, to: Animation, duration: number): void;
-        getMix(from: Animation, to: Animation): number;
-    }
+	class AnimationStateData {
+		skeletonData: SkeletonData;
+		animationToMixTime: Map<number>;
+		defaultMix: number;
+		constructor(skeletonData: SkeletonData);
+		setMix(fromName: string, toName: string, duration: number): void;
+		setMixWith(from: Animation, to: Animation, duration: number): void;
+		getMix(from: Animation, to: Animation): number;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class AssetManager implements Disposable {
-        private pathPrefix;
-        private textureLoader;
-        private assets;
-        private errors;
-        private toLoad;
-        private loaded;
-        constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
-        loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
-        loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
-        loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
-        get(path: string): any;
-        remove(path: string): void;
-        removeAll(): void;
-        isLoadingComplete(): boolean;
-        getToLoad(): number;
-        getLoaded(): number;
-        dispose(): void;
-        hasErrors(): boolean;
-        getErrors(): Map<string>;
-    }
+	class AssetManager implements Disposable {
+		private pathPrefix;
+		private textureLoader;
+		private assets;
+		private errors;
+		private toLoad;
+		private loaded;
+		constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
+		loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
+		loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
+		loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
+		get(path: string): any;
+		remove(path: string): void;
+		removeAll(): void;
+		isLoadingComplete(): boolean;
+		getToLoad(): number;
+		getLoaded(): number;
+		dispose(): void;
+		hasErrors(): boolean;
+		getErrors(): Map<string>;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class AtlasAttachmentLoader implements AttachmentLoader {
-        atlas: TextureAtlas;
-        constructor(atlas: TextureAtlas);
-        newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-        newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-        newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-        newPathAttachment(skin: Skin, name: string): PathAttachment;
-        newPointAttachment(skin: Skin, name: string): PointAttachment;
-        newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
-    }
+	class AtlasAttachmentLoader implements AttachmentLoader {
+		atlas: TextureAtlas;
+		constructor(atlas: TextureAtlas);
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+		newPointAttachment(skin: Skin, name: string): PointAttachment;
+		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    enum BlendMode {
-        Normal = 0,
-        Additive = 1,
-        Multiply = 2,
-        Screen = 3,
-    }
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class Bone implements Updatable {
-        data: BoneData;
-        skeleton: Skeleton;
-        parent: Bone;
-        children: Bone[];
-        x: number;
-        y: number;
-        rotation: number;
-        scaleX: number;
-        scaleY: number;
-        shearX: number;
-        shearY: number;
-        ax: number;
-        ay: number;
-        arotation: number;
-        ascaleX: number;
-        ascaleY: number;
-        ashearX: number;
-        ashearY: number;
-        appliedValid: boolean;
-        a: number;
-        b: number;
-        worldX: number;
-        c: number;
-        d: number;
-        worldY: number;
-        sorted: boolean;
-        constructor(data: BoneData, skeleton: Skeleton, parent: Bone);
-        update(): void;
-        updateWorldTransform(): void;
-        updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void;
-        setToSetupPose(): void;
-        getWorldRotationX(): number;
-        getWorldRotationY(): number;
-        getWorldScaleX(): number;
-        getWorldScaleY(): number;
-        updateAppliedTransform(): void;
-        worldToLocal(world: Vector2): Vector2;
-        localToWorld(local: Vector2): Vector2;
-        worldToLocalRotation(worldRotation: number): number;
-        localToWorldRotation(localRotation: number): number;
-        rotateWorld(degrees: number): void;
-    }
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+		newPointAttachment(skin: Skin, name: string): PointAttachment;
+		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class BoneData {
-        index: number;
-        name: string;
-        parent: BoneData;
-        length: number;
-        x: number;
-        y: number;
-        rotation: number;
-        scaleX: number;
-        scaleY: number;
-        shearX: number;
-        shearY: number;
-        transformMode: TransformMode;
-        constructor(index: number, name: string, parent: BoneData);
-    }
-    enum TransformMode {
-        Normal = 0,
-        OnlyTranslation = 1,
-        NoRotationOrReflection = 2,
-        NoScale = 3,
-        NoScaleOrReflection = 4,
-    }
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+		Point = 5,
+	}
 }
 }
 declare module spine {
 declare module spine {
-    interface Constraint extends Updatable {
-        getOrder(): number;
-    }
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class Event {
-        data: EventData;
-        intValue: number;
-        floatValue: number;
-        stringValue: string;
-        time: number;
-        constructor(time: number, data: EventData);
-    }
+	class ClippingAttachment extends VertexAttachment {
+		endSlot: SlotData;
+		color: Color;
+		constructor(name: string);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class EventData {
-        name: string;
-        intValue: number;
-        floatValue: number;
-        stringValue: string;
-        constructor(name: string);
-    }
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class IkConstraint implements Constraint {
-        data: IkConstraintData;
-        bones: Array<Bone>;
-        target: Bone;
-        mix: number;
-        bendDirection: number;
-        constructor(data: IkConstraintData, skeleton: Skeleton);
-        getOrder(): number;
-        apply(): void;
-        update(): void;
-        apply1(bone: Bone, targetX: number, targetY: number, alpha: number): void;
-        apply2(parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, alpha: number): void;
-    }
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class IkConstraintData {
-        name: string;
-        order: number;
-        bones: BoneData[];
-        target: BoneData;
-        bendDirection: number;
-        mix: number;
-        constructor(name: string);
-    }
+	class PointAttachment extends VertexAttachment {
+		x: number;
+		y: number;
+		rotation: number;
+		color: Color;
+		constructor(name: string);
+		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
+		computeWorldRotation(bone: Bone): number;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class PathConstraint implements Constraint {
-        static NONE: number;
-        static BEFORE: number;
-        static AFTER: number;
-        data: PathConstraintData;
-        bones: Array<Bone>;
-        target: Slot;
-        position: number;
-        spacing: number;
-        rotateMix: number;
-        translateMix: number;
-        spaces: number[];
-        positions: number[];
-        world: number[];
-        curves: number[];
-        lengths: number[];
-        segments: number[];
-        constructor(data: PathConstraintData, skeleton: Skeleton);
-        apply(): void;
-        update(): void;
-        computeWorldPositions(path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): number[];
-        addBeforePosition(p: number, temp: Array<number>, i: number, out: Array<number>, o: number): void;
-        addAfterPosition(p: number, temp: Array<number>, i: number, out: Array<number>, o: number): void;
-        addCurvePosition(p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, out: Array<number>, o: number, tangents: boolean): void;
-        getOrder(): number;
-    }
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		updateOffset(): void;
+		setRegion(region: TextureRegion): void;
+		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class PathConstraintData {
-        name: string;
-        order: number;
-        bones: BoneData[];
-        target: SlotData;
-        positionMode: PositionMode;
-        spacingMode: SpacingMode;
-        rotateMode: RotateMode;
-        offsetRotation: number;
-        position: number;
-        spacing: number;
-        rotateMix: number;
-        translateMix: number;
-        constructor(name: string);
-    }
-    enum PositionMode {
-        Fixed = 0,
-        Percent = 1,
-    }
-    enum SpacingMode {
-        Length = 0,
-        Fixed = 1,
-        Percent = 2,
-    }
-    enum RotateMode {
-        Tangent = 0,
-        Chain = 1,
-        ChainScale = 2,
-    }
+	enum BlendMode {
+		Normal = 0,
+		Additive = 1,
+		Multiply = 2,
+		Screen = 3,
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class SharedAssetManager implements Disposable {
-        private pathPrefix;
-        private clientAssets;
-        private queuedAssets;
-        private rawAssets;
-        private errors;
-        constructor(pathPrefix?: string);
-        private queueAsset(clientId, textureLoader, path);
-        loadText(clientId: string, path: string): void;
-        loadJson(clientId: string, path: string): void;
-        loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
-        get(clientId: string, path: string): any;
-        private updateClientAssets(clientAssets);
-        isLoadingComplete(clientId: string): boolean;
-        dispose(): void;
-        hasErrors(): boolean;
-        getErrors(): Map<string>;
-    }
+	class Bone implements Updatable {
+		data: BoneData;
+		skeleton: Skeleton;
+		parent: Bone;
+		children: Bone[];
+		x: number;
+		y: number;
+		rotation: number;
+		scaleX: number;
+		scaleY: number;
+		shearX: number;
+		shearY: number;
+		ax: number;
+		ay: number;
+		arotation: number;
+		ascaleX: number;
+		ascaleY: number;
+		ashearX: number;
+		ashearY: number;
+		appliedValid: boolean;
+		a: number;
+		b: number;
+		worldX: number;
+		c: number;
+		d: number;
+		worldY: number;
+		sorted: boolean;
+		constructor(data: BoneData, skeleton: Skeleton, parent: Bone);
+		update(): void;
+		updateWorldTransform(): void;
+		updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void;
+		setToSetupPose(): void;
+		getWorldRotationX(): number;
+		getWorldRotationY(): number;
+		getWorldScaleX(): number;
+		getWorldScaleY(): number;
+		updateAppliedTransform(): void;
+		worldToLocal(world: Vector2): Vector2;
+		localToWorld(local: Vector2): Vector2;
+		worldToLocalRotation(worldRotation: number): number;
+		localToWorldRotation(localRotation: number): number;
+		rotateWorld(degrees: number): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class Skeleton {
-        data: SkeletonData;
-        bones: Array<Bone>;
-        slots: Array<Slot>;
-        drawOrder: Array<Slot>;
-        ikConstraints: Array<IkConstraint>;
-        transformConstraints: Array<TransformConstraint>;
-        pathConstraints: Array<PathConstraint>;
-        _updateCache: Updatable[];
-        updateCacheReset: Updatable[];
-        skin: Skin;
-        color: Color;
-        time: number;
-        flipX: boolean;
-        flipY: boolean;
-        x: number;
-        y: number;
-        constructor(data: SkeletonData);
-        updateCache(): void;
-        sortIkConstraint(constraint: IkConstraint): void;
-        sortPathConstraint(constraint: PathConstraint): void;
-        sortTransformConstraint(constraint: TransformConstraint): void;
-        sortPathConstraintAttachment(skin: Skin, slotIndex: number, slotBone: Bone): void;
-        sortPathConstraintAttachmentWith(attachment: Attachment, slotBone: Bone): void;
-        sortBone(bone: Bone): void;
-        sortReset(bones: Array<Bone>): void;
-        updateWorldTransform(): void;
-        setToSetupPose(): void;
-        setBonesToSetupPose(): void;
-        setSlotsToSetupPose(): void;
-        getRootBone(): Bone;
-        findBone(boneName: string): Bone;
-        findBoneIndex(boneName: string): number;
-        findSlot(slotName: string): Slot;
-        findSlotIndex(slotName: string): number;
-        setSkinByName(skinName: string): void;
-        setSkin(newSkin: Skin): void;
-        getAttachmentByName(slotName: string, attachmentName: string): Attachment;
-        getAttachment(slotIndex: number, attachmentName: string): Attachment;
-        setAttachment(slotName: string, attachmentName: string): void;
-        findIkConstraint(constraintName: string): IkConstraint;
-        findTransformConstraint(constraintName: string): TransformConstraint;
-        findPathConstraint(constraintName: string): PathConstraint;
-        getBounds(offset: Vector2, size: Vector2, temp: Array<number>): void;
-        update(delta: number): void;
-    }
+	class BoneData {
+		index: number;
+		name: string;
+		parent: BoneData;
+		length: number;
+		x: number;
+		y: number;
+		rotation: number;
+		scaleX: number;
+		scaleY: number;
+		shearX: number;
+		shearY: number;
+		transformMode: TransformMode;
+		constructor(index: number, name: string, parent: BoneData);
+	}
+	enum TransformMode {
+		Normal = 0,
+		OnlyTranslation = 1,
+		NoRotationOrReflection = 2,
+		NoScale = 3,
+		NoScaleOrReflection = 4,
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class SkeletonBounds {
-        minX: number;
-        minY: number;
-        maxX: number;
-        maxY: number;
-        boundingBoxes: BoundingBoxAttachment[];
-        polygons: ArrayLike<number>[];
-        private polygonPool;
-        update(skeleton: Skeleton, updateAabb: boolean): void;
-        aabbCompute(): void;
-        aabbContainsPoint(x: number, y: number): boolean;
-        aabbIntersectsSegment(x1: number, y1: number, x2: number, y2: number): boolean;
-        aabbIntersectsSkeleton(bounds: SkeletonBounds): boolean;
-        containsPoint(x: number, y: number): BoundingBoxAttachment;
-        containsPointPolygon(polygon: ArrayLike<number>, x: number, y: number): boolean;
-        intersectsSegment(x1: number, y1: number, x2: number, y2: number): BoundingBoxAttachment;
-        intersectsSegmentPolygon(polygon: ArrayLike<number>, x1: number, y1: number, x2: number, y2: number): boolean;
-        getPolygon(boundingBox: BoundingBoxAttachment): ArrayLike<number>;
-        getWidth(): number;
-        getHeight(): number;
-    }
+	interface Constraint extends Updatable {
+		getOrder(): number;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class SkeletonClipping {
-        private triangulator;
-        private clippingPolygon;
-        private clipOutput;
-        clippedVertices: number[];
-        clippedTriangles: number[];
-        private scratch;
-        private clipAttachment;
-        private clippingPolygons;
-        clipStart(slot: Slot, clip: ClippingAttachment): number;
-        clipEndWithSlot(slot: Slot): void;
-        clipEnd(): void;
-        isClipping(): boolean;
-        clipTriangles(vertices: ArrayLike<number>, verticesLength: number, triangles: ArrayLike<number>, trianglesLength: number, uvs: ArrayLike<number>, light: Color, dark: Color, twoColor: boolean): void;
-        clip(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array<number>, output: Array<number>): boolean;
-        static makeClockwise(polygon: ArrayLike<number>): void;
-    }
+	class Event {
+		data: EventData;
+		intValue: number;
+		floatValue: number;
+		stringValue: string;
+		time: number;
+		constructor(time: number, data: EventData);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class SkeletonData {
-        name: string;
-        bones: BoneData[];
-        slots: SlotData[];
-        skins: Skin[];
-        defaultSkin: Skin;
-        events: EventData[];
-        animations: Animation[];
-        ikConstraints: IkConstraintData[];
-        transformConstraints: TransformConstraintData[];
-        pathConstraints: PathConstraintData[];
-        width: number;
-        height: number;
-        version: string;
-        hash: string;
-        fps: number;
-        imagesPath: string;
-        findBone(boneName: string): BoneData;
-        findBoneIndex(boneName: string): number;
-        findSlot(slotName: string): SlotData;
-        findSlotIndex(slotName: string): number;
-        findSkin(skinName: string): Skin;
-        findEvent(eventDataName: string): EventData;
-        findAnimation(animationName: string): Animation;
-        findIkConstraint(constraintName: string): IkConstraintData;
-        findTransformConstraint(constraintName: string): TransformConstraintData;
-        findPathConstraint(constraintName: string): PathConstraintData;
-        findPathConstraintIndex(pathConstraintName: string): number;
-    }
+	class EventData {
+		name: string;
+		intValue: number;
+		floatValue: number;
+		stringValue: string;
+		constructor(name: string);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class SkeletonJson {
-        attachmentLoader: AttachmentLoader;
-        scale: number;
-        private linkedMeshes;
-        constructor(attachmentLoader: AttachmentLoader);
-        readSkeletonData(json: string | any): SkeletonData;
-        readAttachment(map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment;
-        readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void;
-        readAnimation(map: any, name: string, skeletonData: SkeletonData): void;
-        readCurve(map: any, timeline: CurveTimeline, frameIndex: number): void;
-        getValue(map: any, prop: string, defaultValue: any): any;
-        static blendModeFromString(str: string): BlendMode;
-        static positionModeFromString(str: string): PositionMode;
-        static spacingModeFromString(str: string): SpacingMode;
-        static rotateModeFromString(str: string): RotateMode;
-        static transformModeFromString(str: string): TransformMode;
-    }
+	class IkConstraint implements Constraint {
+		data: IkConstraintData;
+		bones: Array<Bone>;
+		target: Bone;
+		mix: number;
+		bendDirection: number;
+		constructor(data: IkConstraintData, skeleton: Skeleton);
+		getOrder(): number;
+		apply(): void;
+		update(): void;
+		apply1(bone: Bone, targetX: number, targetY: number, alpha: number): void;
+		apply2(parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, alpha: number): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class Skin {
-        name: string;
-        attachments: Map<Attachment>[];
-        constructor(name: string);
-        addAttachment(slotIndex: number, name: string, attachment: Attachment): void;
-        getAttachment(slotIndex: number, name: string): Attachment;
-        attachAll(skeleton: Skeleton, oldSkin: Skin): void;
-    }
+	class IkConstraintData {
+		name: string;
+		order: number;
+		bones: BoneData[];
+		target: BoneData;
+		bendDirection: number;
+		mix: number;
+		constructor(name: string);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class Slot {
-        data: SlotData;
-        bone: Bone;
-        color: Color;
-        darkColor: Color;
-        private attachment;
-        private attachmentTime;
-        attachmentVertices: number[];
-        constructor(data: SlotData, bone: Bone);
-        getAttachment(): Attachment;
-        setAttachment(attachment: Attachment): void;
-        setAttachmentTime(time: number): void;
-        getAttachmentTime(): number;
-        setToSetupPose(): void;
-    }
+	class PathConstraint implements Constraint {
+		static NONE: number;
+		static BEFORE: number;
+		static AFTER: number;
+		data: PathConstraintData;
+		bones: Array<Bone>;
+		target: Slot;
+		position: number;
+		spacing: number;
+		rotateMix: number;
+		translateMix: number;
+		spaces: number[];
+		positions: number[];
+		world: number[];
+		curves: number[];
+		lengths: number[];
+		segments: number[];
+		constructor(data: PathConstraintData, skeleton: Skeleton);
+		apply(): void;
+		update(): void;
+		computeWorldPositions(path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): number[];
+		addBeforePosition(p: number, temp: Array<number>, i: number, out: Array<number>, o: number): void;
+		addAfterPosition(p: number, temp: Array<number>, i: number, out: Array<number>, o: number): void;
+		addCurvePosition(p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, out: Array<number>, o: number, tangents: boolean): void;
+		getOrder(): number;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class SlotData {
-        index: number;
-        name: string;
-        boneData: BoneData;
-        color: Color;
-        darkColor: Color;
-        attachmentName: string;
-        blendMode: BlendMode;
-        constructor(index: number, name: string, boneData: BoneData);
-    }
+	class PathConstraintData {
+		name: string;
+		order: number;
+		bones: BoneData[];
+		target: SlotData;
+		positionMode: PositionMode;
+		spacingMode: SpacingMode;
+		rotateMode: RotateMode;
+		offsetRotation: number;
+		position: number;
+		spacing: number;
+		rotateMix: number;
+		translateMix: number;
+		constructor(name: string);
+	}
+	enum PositionMode {
+		Fixed = 0,
+		Percent = 1,
+	}
+	enum SpacingMode {
+		Length = 0,
+		Fixed = 1,
+		Percent = 2,
+	}
+	enum RotateMode {
+		Tangent = 0,
+		Chain = 1,
+		ChainScale = 2,
+	}
 }
 }
 declare module spine {
 declare module spine {
-    abstract class Texture {
-        protected _image: HTMLImageElement;
-        constructor(image: HTMLImageElement);
-        getImage(): HTMLImageElement;
-        abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-        abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
-        abstract dispose(): void;
-        static filterFromString(text: string): TextureFilter;
-        static wrapFromString(text: string): TextureWrap;
-    }
-    enum TextureFilter {
-        Nearest = 9728,
-        Linear = 9729,
-        MipMap = 9987,
-        MipMapNearestNearest = 9984,
-        MipMapLinearNearest = 9985,
-        MipMapNearestLinear = 9986,
-        MipMapLinearLinear = 9987,
-    }
-    enum TextureWrap {
-        MirroredRepeat = 33648,
-        ClampToEdge = 33071,
-        Repeat = 10497,
-    }
-    class TextureRegion {
-        renderObject: any;
-        u: number;
-        v: number;
-        u2: number;
-        v2: number;
-        width: number;
-        height: number;
-        rotate: boolean;
-        offsetX: number;
-        offsetY: number;
-        originalWidth: number;
-        originalHeight: number;
-    }
+	class SharedAssetManager implements Disposable {
+		private pathPrefix;
+		private clientAssets;
+		private queuedAssets;
+		private rawAssets;
+		private errors;
+		constructor(pathPrefix?: string);
+		private queueAsset(clientId, textureLoader, path);
+		loadText(clientId: string, path: string): void;
+		loadJson(clientId: string, path: string): void;
+		loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
+		get(clientId: string, path: string): any;
+		private updateClientAssets(clientAssets);
+		isLoadingComplete(clientId: string): boolean;
+		dispose(): void;
+		hasErrors(): boolean;
+		getErrors(): Map<string>;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class TextureAtlas implements Disposable {
-        pages: TextureAtlasPage[];
-        regions: TextureAtlasRegion[];
-        constructor(atlasText: string, textureLoader: (path: string) => any);
-        private load(atlasText, textureLoader);
-        findRegion(name: string): TextureAtlasRegion;
-        dispose(): void;
-    }
-    class TextureAtlasPage {
-        name: string;
-        minFilter: TextureFilter;
-        magFilter: TextureFilter;
-        uWrap: TextureWrap;
-        vWrap: TextureWrap;
-        texture: Texture;
-        width: number;
-        height: number;
-    }
-    class TextureAtlasRegion extends TextureRegion {
-        page: TextureAtlasPage;
-        name: string;
-        x: number;
-        y: number;
-        index: number;
-        rotate: boolean;
-        texture: Texture;
-    }
+	class Skeleton {
+		data: SkeletonData;
+		bones: Array<Bone>;
+		slots: Array<Slot>;
+		drawOrder: Array<Slot>;
+		ikConstraints: Array<IkConstraint>;
+		transformConstraints: Array<TransformConstraint>;
+		pathConstraints: Array<PathConstraint>;
+		_updateCache: Updatable[];
+		updateCacheReset: Updatable[];
+		skin: Skin;
+		color: Color;
+		time: number;
+		flipX: boolean;
+		flipY: boolean;
+		x: number;
+		y: number;
+		constructor(data: SkeletonData);
+		updateCache(): void;
+		sortIkConstraint(constraint: IkConstraint): void;
+		sortPathConstraint(constraint: PathConstraint): void;
+		sortTransformConstraint(constraint: TransformConstraint): void;
+		sortPathConstraintAttachment(skin: Skin, slotIndex: number, slotBone: Bone): void;
+		sortPathConstraintAttachmentWith(attachment: Attachment, slotBone: Bone): void;
+		sortBone(bone: Bone): void;
+		sortReset(bones: Array<Bone>): void;
+		updateWorldTransform(): void;
+		setToSetupPose(): void;
+		setBonesToSetupPose(): void;
+		setSlotsToSetupPose(): void;
+		getRootBone(): Bone;
+		findBone(boneName: string): Bone;
+		findBoneIndex(boneName: string): number;
+		findSlot(slotName: string): Slot;
+		findSlotIndex(slotName: string): number;
+		setSkinByName(skinName: string): void;
+		setSkin(newSkin: Skin): void;
+		getAttachmentByName(slotName: string, attachmentName: string): Attachment;
+		getAttachment(slotIndex: number, attachmentName: string): Attachment;
+		setAttachment(slotName: string, attachmentName: string): void;
+		findIkConstraint(constraintName: string): IkConstraint;
+		findTransformConstraint(constraintName: string): TransformConstraint;
+		findPathConstraint(constraintName: string): PathConstraint;
+		getBounds(offset: Vector2, size: Vector2, temp: Array<number>): void;
+		update(delta: number): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class TransformConstraint implements Constraint {
-        data: TransformConstraintData;
-        bones: Array<Bone>;
-        target: Bone;
-        rotateMix: number;
-        translateMix: number;
-        scaleMix: number;
-        shearMix: number;
-        temp: Vector2;
-        constructor(data: TransformConstraintData, skeleton: Skeleton);
-        apply(): void;
-        update(): void;
-        applyAbsoluteWorld(): void;
-        applyRelativeWorld(): void;
-        applyAbsoluteLocal(): void;
-        applyRelativeLocal(): void;
-        getOrder(): number;
-    }
+	class SkeletonBounds {
+		minX: number;
+		minY: number;
+		maxX: number;
+		maxY: number;
+		boundingBoxes: BoundingBoxAttachment[];
+		polygons: ArrayLike<number>[];
+		private polygonPool;
+		update(skeleton: Skeleton, updateAabb: boolean): void;
+		aabbCompute(): void;
+		aabbContainsPoint(x: number, y: number): boolean;
+		aabbIntersectsSegment(x1: number, y1: number, x2: number, y2: number): boolean;
+		aabbIntersectsSkeleton(bounds: SkeletonBounds): boolean;
+		containsPoint(x: number, y: number): BoundingBoxAttachment;
+		containsPointPolygon(polygon: ArrayLike<number>, x: number, y: number): boolean;
+		intersectsSegment(x1: number, y1: number, x2: number, y2: number): BoundingBoxAttachment;
+		intersectsSegmentPolygon(polygon: ArrayLike<number>, x1: number, y1: number, x2: number, y2: number): boolean;
+		getPolygon(boundingBox: BoundingBoxAttachment): ArrayLike<number>;
+		getWidth(): number;
+		getHeight(): number;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class TransformConstraintData {
-        name: string;
-        order: number;
-        bones: BoneData[];
-        target: BoneData;
-        rotateMix: number;
-        translateMix: number;
-        scaleMix: number;
-        shearMix: number;
-        offsetRotation: number;
-        offsetX: number;
-        offsetY: number;
-        offsetScaleX: number;
-        offsetScaleY: number;
-        offsetShearY: number;
-        relative: boolean;
-        local: boolean;
-        constructor(name: string);
-    }
+	class SkeletonClipping {
+		private triangulator;
+		private clippingPolygon;
+		private clipOutput;
+		clippedVertices: number[];
+		clippedTriangles: number[];
+		private scratch;
+		private clipAttachment;
+		private clippingPolygons;
+		clipStart(slot: Slot, clip: ClippingAttachment): number;
+		clipEndWithSlot(slot: Slot): void;
+		clipEnd(): void;
+		isClipping(): boolean;
+		clipTriangles(vertices: ArrayLike<number>, verticesLength: number, triangles: ArrayLike<number>, trianglesLength: number, uvs: ArrayLike<number>, light: Color, dark: Color, twoColor: boolean): void;
+		clip(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array<number>, output: Array<number>): boolean;
+		static makeClockwise(polygon: ArrayLike<number>): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class Triangulator {
-        private convexPolygons;
-        private convexPolygonsIndices;
-        private indicesArray;
-        private isConcaveArray;
-        private triangles;
-        private polygonPool;
-        private polygonIndicesPool;
-        triangulate(verticesArray: ArrayLike<number>): Array<number>;
-        decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
-        private static isConcave(index, vertexCount, vertices, indices);
-        private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
-        private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
-    }
+	class SkeletonData {
+		name: string;
+		bones: BoneData[];
+		slots: SlotData[];
+		skins: Skin[];
+		defaultSkin: Skin;
+		events: EventData[];
+		animations: Animation[];
+		ikConstraints: IkConstraintData[];
+		transformConstraints: TransformConstraintData[];
+		pathConstraints: PathConstraintData[];
+		width: number;
+		height: number;
+		version: string;
+		hash: string;
+		fps: number;
+		imagesPath: string;
+		findBone(boneName: string): BoneData;
+		findBoneIndex(boneName: string): number;
+		findSlot(slotName: string): SlotData;
+		findSlotIndex(slotName: string): number;
+		findSkin(skinName: string): Skin;
+		findEvent(eventDataName: string): EventData;
+		findAnimation(animationName: string): Animation;
+		findIkConstraint(constraintName: string): IkConstraintData;
+		findTransformConstraint(constraintName: string): TransformConstraintData;
+		findPathConstraint(constraintName: string): PathConstraintData;
+		findPathConstraintIndex(pathConstraintName: string): number;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    interface Updatable {
-        update(): void;
-    }
+	class SkeletonJson {
+		attachmentLoader: AttachmentLoader;
+		scale: number;
+		private linkedMeshes;
+		constructor(attachmentLoader: AttachmentLoader);
+		readSkeletonData(json: string | any): SkeletonData;
+		readAttachment(map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment;
+		readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void;
+		readAnimation(map: any, name: string, skeletonData: SkeletonData): void;
+		readCurve(map: any, timeline: CurveTimeline, frameIndex: number): void;
+		getValue(map: any, prop: string, defaultValue: any): any;
+		static blendModeFromString(str: string): BlendMode;
+		static positionModeFromString(str: string): PositionMode;
+		static spacingModeFromString(str: string): SpacingMode;
+		static rotateModeFromString(str: string): RotateMode;
+		static transformModeFromString(str: string): TransformMode;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    interface Map<T> {
-        [key: string]: T;
-    }
-    class IntSet {
-        array: number[];
-        add(value: number): boolean;
-        contains(value: number): boolean;
-        remove(value: number): void;
-        clear(): void;
-    }
-    interface Disposable {
-        dispose(): void;
-    }
-    interface Restorable {
-        restore(): void;
-    }
-    class Color {
-        r: number;
-        g: number;
-        b: number;
-        a: number;
-        static WHITE: Color;
-        static RED: Color;
-        static GREEN: Color;
-        static BLUE: Color;
-        static MAGENTA: Color;
-        constructor(r?: number, g?: number, b?: number, a?: number);
-        set(r: number, g: number, b: number, a: number): this;
-        setFromColor(c: Color): this;
-        setFromString(hex: string): this;
-        add(r: number, g: number, b: number, a: number): this;
-        clamp(): this;
-    }
-    class MathUtils {
-        static PI: number;
-        static PI2: number;
-        static radiansToDegrees: number;
-        static radDeg: number;
-        static degreesToRadians: number;
-        static degRad: number;
-        static clamp(value: number, min: number, max: number): number;
-        static cosDeg(degrees: number): number;
-        static sinDeg(degrees: number): number;
-        static signum(value: number): number;
-        static toInt(x: number): number;
-        static cbrt(x: number): number;
-    }
-    class Utils {
-        static SUPPORTS_TYPED_ARRAYS: boolean;
-        static arrayCopy<T>(source: ArrayLike<T>, sourceStart: number, dest: ArrayLike<T>, destStart: number, numElements: number): void;
-        static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
-        static ensureArrayCapacity<T>(array: Array<T>, size: number, value?: any): Array<T>;
-        static newArray<T>(size: number, defaultValue: T): Array<T>;
-        static newFloatArray(size: number): ArrayLike<number>;
-        static newShortArray(size: number): ArrayLike<number>;
-        static toFloatArray(array: Array<number>): number[] | Float32Array;
-    }
-    class DebugUtils {
-        static logBones(skeleton: Skeleton): void;
-    }
-    class Pool<T> {
-        private items;
-        private instantiator;
-        constructor(instantiator: () => T);
-        obtain(): T;
-        free(item: T): void;
-        freeAll(items: ArrayLike<T>): void;
-        clear(): void;
-    }
-    class Vector2 {
-        x: number;
-        y: number;
-        constructor(x?: number, y?: number);
-        set(x: number, y: number): Vector2;
-        length(): number;
-        normalize(): this;
-    }
-    class TimeKeeper {
-        maxDelta: number;
-        framesPerSecond: number;
-        delta: number;
-        totalTime: number;
-        private lastTime;
-        private frameCount;
-        private frameTime;
-        update(): void;
-    }
-    interface ArrayLike<T> {
-        length: number;
-        [n: number]: T;
-    }
-    class WindowedMean {
-        values: Array<number>;
-        addedValues: number;
-        lastValue: number;
-        mean: number;
-        dirty: boolean;
-        constructor(windowSize?: number);
-        hasEnoughData(): boolean;
-        addValue(value: number): void;
-        getMean(): number;
-    }
+	class Skin {
+		name: string;
+		attachments: Map<Attachment>[];
+		constructor(name: string);
+		addAttachment(slotIndex: number, name: string, attachment: Attachment): void;
+		getAttachment(slotIndex: number, name: string): Attachment;
+		attachAll(skeleton: Skeleton, oldSkin: Skin): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    abstract class Attachment {
-        name: string;
-        constructor(name: string);
-    }
-    abstract class VertexAttachment extends Attachment {
-        bones: Array<number>;
-        vertices: ArrayLike<number>;
-        worldVerticesLength: number;
-        constructor(name: string);
-        computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-        applyDeform(sourceAttachment: VertexAttachment): boolean;
-    }
+	class Slot {
+		data: SlotData;
+		bone: Bone;
+		color: Color;
+		darkColor: Color;
+		private attachment;
+		private attachmentTime;
+		attachmentVertices: number[];
+		constructor(data: SlotData, bone: Bone);
+		getAttachment(): Attachment;
+		setAttachment(attachment: Attachment): void;
+		setAttachmentTime(time: number): void;
+		getAttachmentTime(): number;
+		setToSetupPose(): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    interface AttachmentLoader {
-        newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-        newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-        newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-        newPathAttachment(skin: Skin, name: string): PathAttachment;
-        newPointAttachment(skin: Skin, name: string): PointAttachment;
-        newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
-    }
+	class SlotData {
+		index: number;
+		name: string;
+		boneData: BoneData;
+		color: Color;
+		darkColor: Color;
+		attachmentName: string;
+		blendMode: BlendMode;
+		constructor(index: number, name: string, boneData: BoneData);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    enum AttachmentType {
-        Region = 0,
-        BoundingBox = 1,
-        Mesh = 2,
-        LinkedMesh = 3,
-        Path = 4,
-        Point = 5,
-    }
+	abstract class Texture {
+		protected _image: HTMLImageElement;
+		constructor(image: HTMLImageElement);
+		getImage(): HTMLImageElement;
+		abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
+		abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
+		abstract dispose(): void;
+		static filterFromString(text: string): TextureFilter;
+		static wrapFromString(text: string): TextureWrap;
+	}
+	enum TextureFilter {
+		Nearest = 9728,
+		Linear = 9729,
+		MipMap = 9987,
+		MipMapNearestNearest = 9984,
+		MipMapLinearNearest = 9985,
+		MipMapNearestLinear = 9986,
+		MipMapLinearLinear = 9987,
+	}
+	enum TextureWrap {
+		MirroredRepeat = 33648,
+		ClampToEdge = 33071,
+		Repeat = 10497,
+	}
+	class TextureRegion {
+		renderObject: any;
+		u: number;
+		v: number;
+		u2: number;
+		v2: number;
+		width: number;
+		height: number;
+		rotate: boolean;
+		offsetX: number;
+		offsetY: number;
+		originalWidth: number;
+		originalHeight: number;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class BoundingBoxAttachment extends VertexAttachment {
-        color: Color;
-        constructor(name: string);
-    }
+	class TextureAtlas implements Disposable {
+		pages: TextureAtlasPage[];
+		regions: TextureAtlasRegion[];
+		constructor(atlasText: string, textureLoader: (path: string) => any);
+		private load(atlasText, textureLoader);
+		findRegion(name: string): TextureAtlasRegion;
+		dispose(): void;
+	}
+	class TextureAtlasPage {
+		name: string;
+		minFilter: TextureFilter;
+		magFilter: TextureFilter;
+		uWrap: TextureWrap;
+		vWrap: TextureWrap;
+		texture: Texture;
+		width: number;
+		height: number;
+	}
+	class TextureAtlasRegion extends TextureRegion {
+		page: TextureAtlasPage;
+		name: string;
+		x: number;
+		y: number;
+		index: number;
+		rotate: boolean;
+		texture: Texture;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class ClippingAttachment extends VertexAttachment {
-        endSlot: SlotData;
-        color: Color;
-        constructor(name: string);
-    }
+	class TransformConstraint implements Constraint {
+		data: TransformConstraintData;
+		bones: Array<Bone>;
+		target: Bone;
+		rotateMix: number;
+		translateMix: number;
+		scaleMix: number;
+		shearMix: number;
+		temp: Vector2;
+		constructor(data: TransformConstraintData, skeleton: Skeleton);
+		apply(): void;
+		update(): void;
+		applyAbsoluteWorld(): void;
+		applyRelativeWorld(): void;
+		applyAbsoluteLocal(): void;
+		applyRelativeLocal(): void;
+		getOrder(): number;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class MeshAttachment extends VertexAttachment {
-        region: TextureRegion;
-        path: string;
-        regionUVs: ArrayLike<number>;
-        uvs: ArrayLike<number>;
-        triangles: Array<number>;
-        color: Color;
-        hullLength: number;
-        private parentMesh;
-        inheritDeform: boolean;
-        tempColor: Color;
-        constructor(name: string);
-        updateUVs(): void;
-        applyDeform(sourceAttachment: VertexAttachment): boolean;
-        getParentMesh(): MeshAttachment;
-        setParentMesh(parentMesh: MeshAttachment): void;
-    }
+	class TransformConstraintData {
+		name: string;
+		order: number;
+		bones: BoneData[];
+		target: BoneData;
+		rotateMix: number;
+		translateMix: number;
+		scaleMix: number;
+		shearMix: number;
+		offsetRotation: number;
+		offsetX: number;
+		offsetY: number;
+		offsetScaleX: number;
+		offsetScaleY: number;
+		offsetShearY: number;
+		relative: boolean;
+		local: boolean;
+		constructor(name: string);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class PathAttachment extends VertexAttachment {
-        lengths: Array<number>;
-        closed: boolean;
-        constantSpeed: boolean;
-        color: Color;
-        constructor(name: string);
-    }
+	class Triangulator {
+		private convexPolygons;
+		private convexPolygonsIndices;
+		private indicesArray;
+		private isConcaveArray;
+		private triangles;
+		private polygonPool;
+		private polygonIndicesPool;
+		triangulate(verticesArray: ArrayLike<number>): Array<number>;
+		decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
+		private static isConcave(index, vertexCount, vertices, indices);
+		private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
+		private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class PointAttachment extends VertexAttachment {
-        x: number;
-        y: number;
-        rotation: number;
-        color: Color;
-        constructor(name: string);
-        computeWorldPosition(bone: Bone, point: Vector2): Vector2;
-        computeWorldRotation(bone: Bone): number;
-    }
+	interface Updatable {
+		update(): void;
+	}
 }
 }
 declare module spine {
 declare module spine {
-    class RegionAttachment extends Attachment {
-        static OX1: number;
-        static OY1: number;
-        static OX2: number;
-        static OY2: number;
-        static OX3: number;
-        static OY3: number;
-        static OX4: number;
-        static OY4: number;
-        static X1: number;
-        static Y1: number;
-        static C1R: number;
-        static C1G: number;
-        static C1B: number;
-        static C1A: number;
-        static U1: number;
-        static V1: number;
-        static X2: number;
-        static Y2: number;
-        static C2R: number;
-        static C2G: number;
-        static C2B: number;
-        static C2A: number;
-        static U2: number;
-        static V2: number;
-        static X3: number;
-        static Y3: number;
-        static C3R: number;
-        static C3G: number;
-        static C3B: number;
-        static C3A: number;
-        static U3: number;
-        static V3: number;
-        static X4: number;
-        static Y4: number;
-        static C4R: number;
-        static C4G: number;
-        static C4B: number;
-        static C4A: number;
-        static U4: number;
-        static V4: number;
-        x: number;
-        y: number;
-        scaleX: number;
-        scaleY: number;
-        rotation: number;
-        width: number;
-        height: number;
-        color: Color;
-        path: string;
-        rendererObject: any;
-        region: TextureRegion;
-        offset: ArrayLike<number>;
-        uvs: ArrayLike<number>;
-        tempColor: Color;
-        constructor(name: string);
-        updateOffset(): void;
-        setRegion(region: TextureRegion): void;
-        computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-    }
+	interface Map<T> {
+		[key: string]: T;
+	}
+	class IntSet {
+		array: number[];
+		add(value: number): boolean;
+		contains(value: number): boolean;
+		remove(value: number): void;
+		clear(): void;
+	}
+	interface Disposable {
+		dispose(): void;
+	}
+	interface Restorable {
+		restore(): void;
+	}
+	class Color {
+		r: number;
+		g: number;
+		b: number;
+		a: number;
+		static WHITE: Color;
+		static RED: Color;
+		static GREEN: Color;
+		static BLUE: Color;
+		static MAGENTA: Color;
+		constructor(r?: number, g?: number, b?: number, a?: number);
+		set(r: number, g: number, b: number, a: number): this;
+		setFromColor(c: Color): this;
+		setFromString(hex: string): this;
+		add(r: number, g: number, b: number, a: number): this;
+		clamp(): this;
+	}
+	class MathUtils {
+		static PI: number;
+		static PI2: number;
+		static radiansToDegrees: number;
+		static radDeg: number;
+		static degreesToRadians: number;
+		static degRad: number;
+		static clamp(value: number, min: number, max: number): number;
+		static cosDeg(degrees: number): number;
+		static sinDeg(degrees: number): number;
+		static signum(value: number): number;
+		static toInt(x: number): number;
+		static cbrt(x: number): number;
+	}
+	class Utils {
+		static SUPPORTS_TYPED_ARRAYS: boolean;
+		static arrayCopy<T>(source: ArrayLike<T>, sourceStart: number, dest: ArrayLike<T>, destStart: number, numElements: number): void;
+		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
+		static ensureArrayCapacity<T>(array: Array<T>, size: number, value?: any): Array<T>;
+		static newArray<T>(size: number, defaultValue: T): Array<T>;
+		static newFloatArray(size: number): ArrayLike<number>;
+		static newShortArray(size: number): ArrayLike<number>;
+		static toFloatArray(array: Array<number>): number[] | Float32Array;
+	}
+	class DebugUtils {
+		static logBones(skeleton: Skeleton): void;
+	}
+	class Pool<T> {
+		private items;
+		private instantiator;
+		constructor(instantiator: () => T);
+		obtain(): T;
+		free(item: T): void;
+		freeAll(items: ArrayLike<T>): void;
+		clear(): void;
+	}
+	class Vector2 {
+		x: number;
+		y: number;
+		constructor(x?: number, y?: number);
+		set(x: number, y: number): Vector2;
+		length(): number;
+		normalize(): this;
+	}
+	class TimeKeeper {
+		maxDelta: number;
+		framesPerSecond: number;
+		delta: number;
+		totalTime: number;
+		private lastTime;
+		private frameCount;
+		private frameTime;
+		update(): void;
+	}
+	interface ArrayLike<T> {
+		length: number;
+		[n: number]: T;
+	}
+	class WindowedMean {
+		values: Array<number>;
+		addedValues: number;
+		lastValue: number;
+		mean: number;
+		dirty: boolean;
+		constructor(windowSize?: number);
+		hasEnoughData(): boolean;
+		addValue(value: number): void;
+		getMean(): number;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class AssetManager extends spine.AssetManager {
-        constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix?: string);
-    }
+	class AssetManager extends spine.AssetManager {
+		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix?: string);
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class OrthoCamera {
-        position: Vector3;
-        direction: Vector3;
-        up: Vector3;
-        near: number;
-        far: number;
-        zoom: number;
-        viewportWidth: number;
-        viewportHeight: number;
-        projectionView: Matrix4;
-        inverseProjectionView: Matrix4;
-        projection: Matrix4;
-        view: Matrix4;
-        private tmp;
-        constructor(viewportWidth: number, viewportHeight: number);
-        update(): void;
-        screenToWorld(screenCoords: Vector3, screenWidth: number, screenHeight: number): Vector3;
-        setViewport(viewportWidth: number, viewportHeight: number): void;
-    }
+	class OrthoCamera {
+		position: Vector3;
+		direction: Vector3;
+		up: Vector3;
+		near: number;
+		far: number;
+		zoom: number;
+		viewportWidth: number;
+		viewportHeight: number;
+		projectionView: Matrix4;
+		inverseProjectionView: Matrix4;
+		projection: Matrix4;
+		view: Matrix4;
+		private tmp;
+		constructor(viewportWidth: number, viewportHeight: number);
+		update(): void;
+		screenToWorld(screenCoords: Vector3, screenWidth: number, screenHeight: number): Vector3;
+		setViewport(viewportWidth: number, viewportHeight: number): void;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class GLTexture extends Texture implements Disposable, Restorable {
-        private context;
-        private texture;
-        private boundUnit;
-        private useMipMaps;
-        constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
-        setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-        setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
-        update(useMipMaps: boolean): void;
-        restore(): void;
-        bind(unit?: number): void;
-        unbind(): void;
-        dispose(): void;
-    }
+	class GLTexture extends Texture implements Disposable, Restorable {
+		private context;
+		private texture;
+		private boundUnit;
+		private useMipMaps;
+		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
+		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
+		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
+		update(useMipMaps: boolean): void;
+		restore(): void;
+		bind(unit?: number): void;
+		unbind(): void;
+		dispose(): void;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class Input {
-        element: HTMLElement;
-        lastX: number;
-        lastY: number;
-        buttonDown: boolean;
-        currTouch: Touch;
-        touchesPool: Pool<Touch>;
-        private listeners;
-        constructor(element: HTMLElement);
-        private setupCallbacks(element);
-        addListener(listener: InputListener): void;
-        removeListener(listener: InputListener): void;
-    }
-    class Touch {
-        identifier: number;
-        x: number;
-        y: number;
-        constructor(identifier: number, x: number, y: number);
-    }
-    interface InputListener {
-        down(x: number, y: number): void;
-        up(x: number, y: number): void;
-        moved(x: number, y: number): void;
-        dragged(x: number, y: number): void;
-    }
+	class Input {
+		element: HTMLElement;
+		lastX: number;
+		lastY: number;
+		buttonDown: boolean;
+		currTouch: Touch;
+		touchesPool: Pool<Touch>;
+		private listeners;
+		constructor(element: HTMLElement);
+		private setupCallbacks(element);
+		addListener(listener: InputListener): void;
+		removeListener(listener: InputListener): void;
+	}
+	class Touch {
+		identifier: number;
+		x: number;
+		y: number;
+		constructor(identifier: number, x: number, y: number);
+	}
+	interface InputListener {
+		down(x: number, y: number): void;
+		up(x: number, y: number): void;
+		moved(x: number, y: number): void;
+		dragged(x: number, y: number): void;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class LoadingScreen {
-        static FADE_SECONDS: number;
-        private static loaded;
-        private static spinnerImg;
-        private static logoImg;
-        private renderer;
-        private logo;
-        private spinner;
-        private angle;
-        private fadeOut;
-        private timeKeeper;
-        backgroundColor: Color;
-        private tempColor;
-        private firstDraw;
-        private static SPINNER_DATA;
-        private static SPINE_LOGO_DATA;
-        constructor(renderer: SceneRenderer);
-        draw(complete?: boolean): void;
-    }
+	class LoadingScreen {
+		static FADE_SECONDS: number;
+		private static loaded;
+		private static spinnerImg;
+		private static logoImg;
+		private renderer;
+		private logo;
+		private spinner;
+		private angle;
+		private fadeOut;
+		private timeKeeper;
+		backgroundColor: Color;
+		private tempColor;
+		private firstDraw;
+		private static SPINNER_DATA;
+		private static SPINE_LOGO_DATA;
+		constructor(renderer: SceneRenderer);
+		draw(complete?: boolean): void;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    const M00 = 0;
-    const M01 = 4;
-    const M02 = 8;
-    const M03 = 12;
-    const M10 = 1;
-    const M11 = 5;
-    const M12 = 9;
-    const M13 = 13;
-    const M20 = 2;
-    const M21 = 6;
-    const M22 = 10;
-    const M23 = 14;
-    const M30 = 3;
-    const M31 = 7;
-    const M32 = 11;
-    const M33 = 15;
-    class Matrix4 {
-        temp: Float32Array;
-        values: Float32Array;
-        private static xAxis;
-        private static yAxis;
-        private static zAxis;
-        private static tmpMatrix;
-        constructor();
-        set(values: ArrayLike<number>): Matrix4;
-        transpose(): Matrix4;
-        identity(): Matrix4;
-        invert(): Matrix4;
-        determinant(): number;
-        translate(x: number, y: number, z: number): Matrix4;
-        copy(): Matrix4;
-        projection(near: number, far: number, fovy: number, aspectRatio: number): Matrix4;
-        ortho2d(x: number, y: number, width: number, height: number): Matrix4;
-        ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4;
-        multiply(matrix: Matrix4): Matrix4;
-        multiplyLeft(matrix: Matrix4): Matrix4;
-        lookAt(position: Vector3, direction: Vector3, up: Vector3): this;
-        static initTemps(): void;
-    }
+	const M00: number;
+	const M01: number;
+	const M02: number;
+	const M03: number;
+	const M10: number;
+	const M11: number;
+	const M12: number;
+	const M13: number;
+	const M20: number;
+	const M21: number;
+	const M22: number;
+	const M23: number;
+	const M30: number;
+	const M31: number;
+	const M32: number;
+	const M33: number;
+	class Matrix4 {
+		temp: Float32Array;
+		values: Float32Array;
+		private static xAxis;
+		private static yAxis;
+		private static zAxis;
+		private static tmpMatrix;
+		constructor();
+		set(values: ArrayLike<number>): Matrix4;
+		transpose(): Matrix4;
+		identity(): Matrix4;
+		invert(): Matrix4;
+		determinant(): number;
+		translate(x: number, y: number, z: number): Matrix4;
+		copy(): Matrix4;
+		projection(near: number, far: number, fovy: number, aspectRatio: number): Matrix4;
+		ortho2d(x: number, y: number, width: number, height: number): Matrix4;
+		ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4;
+		multiply(matrix: Matrix4): Matrix4;
+		multiplyLeft(matrix: Matrix4): Matrix4;
+		lookAt(position: Vector3, direction: Vector3, up: Vector3): this;
+		static initTemps(): void;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class Mesh implements Disposable, Restorable {
-        private attributes;
-        private context;
-        private vertices;
-        private verticesBuffer;
-        private verticesLength;
-        private dirtyVertices;
-        private indices;
-        private indicesBuffer;
-        private indicesLength;
-        private dirtyIndices;
-        private elementsPerVertex;
-        getAttributes(): VertexAttribute[];
-        maxVertices(): number;
-        numVertices(): number;
-        setVerticesLength(length: number): void;
-        getVertices(): Float32Array;
-        maxIndices(): number;
-        numIndices(): number;
-        setIndicesLength(length: number): void;
-        getIndices(): Uint16Array;
-        getVertexSizeInFloats(): number;
-        constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, attributes: VertexAttribute[], maxVertices: number, maxIndices: number);
-        setVertices(vertices: Array<number>): void;
-        setIndices(indices: Array<number>): void;
-        draw(shader: Shader, primitiveType: number): void;
-        drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
-        bind(shader: Shader): void;
-        unbind(shader: Shader): void;
-        private update();
-        restore(): void;
-        dispose(): void;
-    }
-    class VertexAttribute {
-        name: string;
-        type: VertexAttributeType;
-        numElements: number;
-        constructor(name: string, type: VertexAttributeType, numElements: number);
-    }
-    class Position2Attribute extends VertexAttribute {
-        constructor();
-    }
-    class Position3Attribute extends VertexAttribute {
-        constructor();
-    }
-    class TexCoordAttribute extends VertexAttribute {
-        constructor(unit?: number);
-    }
-    class ColorAttribute extends VertexAttribute {
-        constructor();
-    }
-    class Color2Attribute extends VertexAttribute {
-        constructor();
-    }
-    enum VertexAttributeType {
-        Float = 0,
-    }
+	class Mesh implements Disposable, Restorable {
+		private attributes;
+		private context;
+		private vertices;
+		private verticesBuffer;
+		private verticesLength;
+		private dirtyVertices;
+		private indices;
+		private indicesBuffer;
+		private indicesLength;
+		private dirtyIndices;
+		private elementsPerVertex;
+		getAttributes(): VertexAttribute[];
+		maxVertices(): number;
+		numVertices(): number;
+		setVerticesLength(length: number): void;
+		getVertices(): Float32Array;
+		maxIndices(): number;
+		numIndices(): number;
+		setIndicesLength(length: number): void;
+		getIndices(): Uint16Array;
+		getVertexSizeInFloats(): number;
+		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, attributes: VertexAttribute[], maxVertices: number, maxIndices: number);
+		setVertices(vertices: Array<number>): void;
+		setIndices(indices: Array<number>): void;
+		draw(shader: Shader, primitiveType: number): void;
+		drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
+		bind(shader: Shader): void;
+		unbind(shader: Shader): void;
+		private update();
+		restore(): void;
+		dispose(): void;
+	}
+	class VertexAttribute {
+		name: string;
+		type: VertexAttributeType;
+		numElements: number;
+		constructor(name: string, type: VertexAttributeType, numElements: number);
+	}
+	class Position2Attribute extends VertexAttribute {
+		constructor();
+	}
+	class Position3Attribute extends VertexAttribute {
+		constructor();
+	}
+	class TexCoordAttribute extends VertexAttribute {
+		constructor(unit?: number);
+	}
+	class ColorAttribute extends VertexAttribute {
+		constructor();
+	}
+	class Color2Attribute extends VertexAttribute {
+		constructor();
+	}
+	enum VertexAttributeType {
+		Float = 0,
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class PolygonBatcher implements Disposable {
-        private context;
-        private drawCalls;
-        private isDrawing;
-        private mesh;
-        private shader;
-        private lastTexture;
-        private verticesLength;
-        private indicesLength;
-        private srcBlend;
-        private dstBlend;
-        constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint?: boolean, maxVertices?: number);
-        begin(shader: Shader): void;
-        setBlendMode(srcBlend: number, dstBlend: number): void;
-        draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
-        private flush();
-        end(): void;
-        getDrawCalls(): number;
-        dispose(): void;
-    }
+	class PolygonBatcher implements Disposable {
+		private context;
+		private drawCalls;
+		private isDrawing;
+		private mesh;
+		private shader;
+		private lastTexture;
+		private verticesLength;
+		private indicesLength;
+		private srcBlend;
+		private dstBlend;
+		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint?: boolean, maxVertices?: number);
+		begin(shader: Shader): void;
+		setBlendMode(srcBlend: number, dstBlend: number): void;
+		draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
+		private flush();
+		end(): void;
+		getDrawCalls(): number;
+		dispose(): void;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class SceneRenderer implements Disposable {
-        context: ManagedWebGLRenderingContext;
-        canvas: HTMLCanvasElement;
-        camera: OrthoCamera;
-        batcher: PolygonBatcher;
-        private twoColorTint;
-        private batcherShader;
-        private shapes;
-        private shapesShader;
-        private activeRenderer;
-        private skeletonRenderer;
-        private skeletonDebugRenderer;
-        private QUAD;
-        private QUAD_TRIANGLES;
-        private WHITE;
-        constructor(canvas: HTMLCanvasElement, context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint?: boolean);
-        begin(): void;
-        drawSkeleton(skeleton: Skeleton, premultipliedAlpha?: boolean): void;
-        drawSkeletonDebug(skeleton: Skeleton, premultipliedAlpha?: boolean, ignoredBones?: Array<string>): void;
-        drawTexture(texture: GLTexture, x: number, y: number, width: number, height: number, color?: Color): void;
-        drawTextureRotated(texture: GLTexture, x: number, y: number, width: number, height: number, pivotX: number, pivotY: number, angle: number, color?: Color, premultipliedAlpha?: boolean): void;
-        drawRegion(region: TextureAtlasRegion, x: number, y: number, width: number, height: number, color?: Color, premultipliedAlpha?: boolean): void;
-        line(x: number, y: number, x2: number, y2: number, color?: Color, color2?: Color): void;
-        triangle(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color): void;
-        quad(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color): void;
-        rect(filled: boolean, x: number, y: number, width: number, height: number, color?: Color): void;
-        rectLine(filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color): void;
-        polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
-        circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
-        curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
-        end(): void;
-        resize(resizeMode: ResizeMode): void;
-        private enableRenderer(renderer);
-        dispose(): void;
-    }
-    enum ResizeMode {
-        Stretch = 0,
-        Expand = 1,
-        Fit = 2,
-    }
+	class SceneRenderer implements Disposable {
+		context: ManagedWebGLRenderingContext;
+		canvas: HTMLCanvasElement;
+		camera: OrthoCamera;
+		batcher: PolygonBatcher;
+		private twoColorTint;
+		private batcherShader;
+		private shapes;
+		private shapesShader;
+		private activeRenderer;
+		private skeletonRenderer;
+		private skeletonDebugRenderer;
+		private QUAD;
+		private QUAD_TRIANGLES;
+		private WHITE;
+		constructor(canvas: HTMLCanvasElement, context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint?: boolean);
+		begin(): void;
+		drawSkeleton(skeleton: Skeleton, premultipliedAlpha?: boolean): void;
+		drawSkeletonDebug(skeleton: Skeleton, premultipliedAlpha?: boolean, ignoredBones?: Array<string>): void;
+		drawTexture(texture: GLTexture, x: number, y: number, width: number, height: number, color?: Color): void;
+		drawTextureRotated(texture: GLTexture, x: number, y: number, width: number, height: number, pivotX: number, pivotY: number, angle: number, color?: Color, premultipliedAlpha?: boolean): void;
+		drawRegion(region: TextureAtlasRegion, x: number, y: number, width: number, height: number, color?: Color, premultipliedAlpha?: boolean): void;
+		line(x: number, y: number, x2: number, y2: number, color?: Color, color2?: Color): void;
+		triangle(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color): void;
+		quad(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color): void;
+		rect(filled: boolean, x: number, y: number, width: number, height: number, color?: Color): void;
+		rectLine(filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color): void;
+		polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
+		circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
+		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
+		end(): void;
+		resize(resizeMode: ResizeMode): void;
+		private enableRenderer(renderer);
+		dispose(): void;
+	}
+	enum ResizeMode {
+		Stretch = 0,
+		Expand = 1,
+		Fit = 2,
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class Shader implements Disposable, Restorable {
-        private vertexShader;
-        private fragmentShader;
-        static MVP_MATRIX: string;
-        static POSITION: string;
-        static COLOR: string;
-        static COLOR2: string;
-        static TEXCOORDS: string;
-        static SAMPLER: string;
-        private context;
-        private vs;
-        private fs;
-        private program;
-        private tmp2x2;
-        private tmp3x3;
-        private tmp4x4;
-        getProgram(): WebGLProgram;
-        getVertexShader(): string;
-        getFragmentShader(): string;
-        constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
-        private compile();
-        private compileShader(type, source);
-        private compileProgram(vs, fs);
-        restore(): void;
-        bind(): void;
-        unbind(): void;
-        setUniformi(uniform: string, value: number): void;
-        setUniformf(uniform: string, value: number): void;
-        setUniform2f(uniform: string, value: number, value2: number): void;
-        setUniform3f(uniform: string, value: number, value2: number, value3: number): void;
-        setUniform4f(uniform: string, value: number, value2: number, value3: number, value4: number): void;
-        setUniform2x2f(uniform: string, value: ArrayLike<number>): void;
-        setUniform3x3f(uniform: string, value: ArrayLike<number>): void;
-        setUniform4x4f(uniform: string, value: ArrayLike<number>): void;
-        getUniformLocation(uniform: string): WebGLUniformLocation;
-        getAttributeLocation(attribute: string): number;
-        dispose(): void;
-        static newColoredTextured(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader;
-        static newTwoColoredTextured(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader;
-        static newColored(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader;
-    }
+	class Shader implements Disposable, Restorable {
+		private vertexShader;
+		private fragmentShader;
+		static MVP_MATRIX: string;
+		static POSITION: string;
+		static COLOR: string;
+		static COLOR2: string;
+		static TEXCOORDS: string;
+		static SAMPLER: string;
+		private context;
+		private vs;
+		private fs;
+		private program;
+		private tmp2x2;
+		private tmp3x3;
+		private tmp4x4;
+		getProgram(): WebGLProgram;
+		getVertexShader(): string;
+		getFragmentShader(): string;
+		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
+		private compile();
+		private compileShader(type, source);
+		private compileProgram(vs, fs);
+		restore(): void;
+		bind(): void;
+		unbind(): void;
+		setUniformi(uniform: string, value: number): void;
+		setUniformf(uniform: string, value: number): void;
+		setUniform2f(uniform: string, value: number, value2: number): void;
+		setUniform3f(uniform: string, value: number, value2: number, value3: number): void;
+		setUniform4f(uniform: string, value: number, value2: number, value3: number, value4: number): void;
+		setUniform2x2f(uniform: string, value: ArrayLike<number>): void;
+		setUniform3x3f(uniform: string, value: ArrayLike<number>): void;
+		setUniform4x4f(uniform: string, value: ArrayLike<number>): void;
+		getUniformLocation(uniform: string): WebGLUniformLocation;
+		getAttributeLocation(attribute: string): number;
+		dispose(): void;
+		static newColoredTextured(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader;
+		static newTwoColoredTextured(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader;
+		static newColored(context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class ShapeRenderer implements Disposable {
-        private context;
-        private isDrawing;
-        private mesh;
-        private shapeType;
-        private color;
-        private shader;
-        private vertexIndex;
-        private tmp;
-        private srcBlend;
-        private dstBlend;
-        constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, maxVertices?: number);
-        begin(shader: Shader): void;
-        setBlendMode(srcBlend: number, dstBlend: number): void;
-        setColor(color: Color): void;
-        setColorWith(r: number, g: number, b: number, a: number): void;
-        point(x: number, y: number, color?: Color): void;
-        line(x: number, y: number, x2: number, y2: number, color?: Color): void;
-        triangle(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color): void;
-        quad(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color): void;
-        rect(filled: boolean, x: number, y: number, width: number, height: number, color?: Color): void;
-        rectLine(filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color): void;
-        x(x: number, y: number, size: number): void;
-        polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
-        circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
-        curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
-        private vertex(x, y, color);
-        end(): void;
-        private flush();
-        private check(shapeType, numVertices);
-        dispose(): void;
-    }
-    enum ShapeType {
-        Point = 0,
-        Line = 1,
-        Filled = 4,
-    }
+	class ShapeRenderer implements Disposable {
+		private context;
+		private isDrawing;
+		private mesh;
+		private shapeType;
+		private color;
+		private shader;
+		private vertexIndex;
+		private tmp;
+		private srcBlend;
+		private dstBlend;
+		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, maxVertices?: number);
+		begin(shader: Shader): void;
+		setBlendMode(srcBlend: number, dstBlend: number): void;
+		setColor(color: Color): void;
+		setColorWith(r: number, g: number, b: number, a: number): void;
+		point(x: number, y: number, color?: Color): void;
+		line(x: number, y: number, x2: number, y2: number, color?: Color): void;
+		triangle(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color): void;
+		quad(filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color): void;
+		rect(filled: boolean, x: number, y: number, width: number, height: number, color?: Color): void;
+		rectLine(filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color): void;
+		x(x: number, y: number, size: number): void;
+		polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
+		circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
+		curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
+		private vertex(x, y, color);
+		end(): void;
+		private flush();
+		private check(shapeType, numVertices);
+		dispose(): void;
+	}
+	enum ShapeType {
+		Point = 0,
+		Line = 1,
+		Filled = 4,
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class SkeletonDebugRenderer implements Disposable {
-        boneLineColor: Color;
-        boneOriginColor: Color;
-        attachmentLineColor: Color;
-        triangleLineColor: Color;
-        pathColor: Color;
-        clipColor: Color;
-        aabbColor: Color;
-        drawBones: boolean;
-        drawRegionAttachments: boolean;
-        drawBoundingBoxes: boolean;
-        drawMeshHull: boolean;
-        drawMeshTriangles: boolean;
-        drawPaths: boolean;
-        drawSkeletonXY: boolean;
-        drawClipping: boolean;
-        premultipliedAlpha: boolean;
-        scale: number;
-        boneWidth: number;
-        private context;
-        private bounds;
-        private temp;
-        private vertices;
-        private static LIGHT_GRAY;
-        private static GREEN;
-        constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext);
-        draw(shapes: ShapeRenderer, skeleton: Skeleton, ignoredBones?: Array<string>): void;
-        dispose(): void;
-    }
+	class SkeletonDebugRenderer implements Disposable {
+		boneLineColor: Color;
+		boneOriginColor: Color;
+		attachmentLineColor: Color;
+		triangleLineColor: Color;
+		pathColor: Color;
+		clipColor: Color;
+		aabbColor: Color;
+		drawBones: boolean;
+		drawRegionAttachments: boolean;
+		drawBoundingBoxes: boolean;
+		drawMeshHull: boolean;
+		drawMeshTriangles: boolean;
+		drawPaths: boolean;
+		drawSkeletonXY: boolean;
+		drawClipping: boolean;
+		premultipliedAlpha: boolean;
+		scale: number;
+		boneWidth: number;
+		private context;
+		private bounds;
+		private temp;
+		private vertices;
+		private static LIGHT_GRAY;
+		private static GREEN;
+		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext);
+		draw(shapes: ShapeRenderer, skeleton: Skeleton, ignoredBones?: Array<string>): void;
+		dispose(): void;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class SkeletonRenderer {
-        static QUAD_TRIANGLES: number[];
-        premultipliedAlpha: boolean;
-        private tempColor;
-        private tempColor2;
-        private vertices;
-        private vertexSize;
-        private twoColorTint;
-        private renderable;
-        private clipper;
-        constructor(context: ManagedWebGLRenderingContext, twoColorTint?: boolean);
-        draw(batcher: PolygonBatcher, skeleton: Skeleton): void;
-    }
+	class SkeletonRenderer {
+		static QUAD_TRIANGLES: number[];
+		premultipliedAlpha: boolean;
+		private tempColor;
+		private tempColor2;
+		private vertices;
+		private vertexSize;
+		private twoColorTint;
+		private renderable;
+		private clipper;
+		constructor(context: ManagedWebGLRenderingContext, twoColorTint?: boolean);
+		draw(batcher: PolygonBatcher, skeleton: Skeleton): void;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class Vector3 {
-        x: number;
-        y: number;
-        z: number;
-        constructor(x?: number, y?: number, z?: number);
-        setFrom(v: Vector3): Vector3;
-        set(x: number, y: number, z: number): Vector3;
-        add(v: Vector3): Vector3;
-        sub(v: Vector3): Vector3;
-        scale(s: number): Vector3;
-        normalize(): Vector3;
-        cross(v: Vector3): Vector3;
-        multiply(matrix: Matrix4): Vector3;
-        project(matrix: Matrix4): Vector3;
-        dot(v: Vector3): number;
-        length(): number;
-        distance(v: Vector3): number;
-    }
+	class Vector3 {
+		x: number;
+		y: number;
+		z: number;
+		constructor(x?: number, y?: number, z?: number);
+		setFrom(v: Vector3): Vector3;
+		set(x: number, y: number, z: number): Vector3;
+		add(v: Vector3): Vector3;
+		sub(v: Vector3): Vector3;
+		scale(s: number): Vector3;
+		normalize(): Vector3;
+		cross(v: Vector3): Vector3;
+		multiply(matrix: Matrix4): Vector3;
+		project(matrix: Matrix4): Vector3;
+		dot(v: Vector3): number;
+		length(): number;
+		distance(v: Vector3): number;
+	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-    class ManagedWebGLRenderingContext {
-        canvas: HTMLCanvasElement;
-        gl: WebGLRenderingContext;
-        private restorables;
-        constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig?: any);
-        addRestorable(restorable: Restorable): void;
-        removeRestorable(restorable: Restorable): void;
-    }
-    class WebGLBlendModeConverter {
-        static ZERO: number;
-        static ONE: number;
-        static SRC_COLOR: number;
-        static ONE_MINUS_SRC_COLOR: number;
-        static SRC_ALPHA: number;
-        static ONE_MINUS_SRC_ALPHA: number;
-        static DST_ALPHA: number;
-        static ONE_MINUS_DST_ALPHA: number;
-        static DST_COLOR: number;
-        static getDestGLBlendMode(blendMode: BlendMode): number;
-        static getSourceGLBlendMode(blendMode: BlendMode, premultipliedAlpha?: boolean): number;
-    }
+	class ManagedWebGLRenderingContext {
+		canvas: HTMLCanvasElement;
+		gl: WebGLRenderingContext;
+		private restorables;
+		constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig?: any);
+		addRestorable(restorable: Restorable): void;
+		removeRestorable(restorable: Restorable): void;
+	}
+	class WebGLBlendModeConverter {
+		static ZERO: number;
+		static ONE: number;
+		static SRC_COLOR: number;
+		static ONE_MINUS_SRC_COLOR: number;
+		static SRC_ALPHA: number;
+		static ONE_MINUS_SRC_ALPHA: number;
+		static DST_ALPHA: number;
+		static ONE_MINUS_DST_ALPHA: number;
+		static DST_COLOR: number;
+		static getDestGLBlendMode(blendMode: BlendMode): number;
+		static getSourceGLBlendMode(blendMode: BlendMode, premultipliedAlpha?: boolean): number;
+	}
 }
 }

Diff do ficheiro suprimidas por serem muito extensas
+ 6416 - 6526
spine-ts/build/spine-webgl.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
spine-ts/build/spine-webgl.js.map


+ 165 - 165
spine-ts/build/spine-widget.d.ts

@@ -245,7 +245,7 @@ declare module spine {
 		constructor(data: AnimationStateData);
 		constructor(data: AnimationStateData);
 		update(delta: number): void;
 		update(delta: number): void;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
 		updateMixingFrom(to: TrackEntry, delta: number): boolean;
-		apply(skeleton: Skeleton): void;
+		apply(skeleton: Skeleton): boolean;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyMixingFrom(to: TrackEntry, skeleton: Skeleton): number;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
 		queueEvents(entry: TrackEntry, animationTime: number): void;
@@ -390,6 +390,154 @@ declare module spine {
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+		newPointAttachment(skin: Skin, name: string): PointAttachment;
+		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+		Point = 5,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class ClippingAttachment extends VertexAttachment {
+		endSlot: SlotData;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class PointAttachment extends VertexAttachment {
+		x: number;
+		y: number;
+		rotation: number;
+		color: Color;
+		constructor(name: string);
+		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
+		computeWorldRotation(bone: Bone): number;
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		uvs: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		updateOffset(): void;
+		setRegion(region: TextureRegion): void;
+		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -1010,154 +1158,6 @@ declare module spine {
 		getMean(): number;
 		getMean(): number;
 	}
 	}
 }
 }
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-		newPointAttachment(skin: Skin, name: string): PointAttachment;
-		newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-		Point = 5,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class ClippingAttachment extends VertexAttachment {
-		endSlot: SlotData;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class PointAttachment extends VertexAttachment {
-		x: number;
-		y: number;
-		rotation: number;
-		color: Color;
-		constructor(name: string);
-		computeWorldPosition(bone: Bone, point: Vector2): Vector2;
-		computeWorldRotation(bone: Bone): number;
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		uvs: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		updateOffset(): void;
-		setRegion(region: TextureRegion): void;
-		computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
-	}
-}
 declare module spine.webgl {
 declare module spine.webgl {
 	class AssetManager extends spine.AssetManager {
 	class AssetManager extends spine.AssetManager {
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix?: string);
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix?: string);
@@ -1249,22 +1249,22 @@ declare module spine.webgl {
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {
-	const M00 = 0;
-	const M01 = 4;
-	const M02 = 8;
-	const M03 = 12;
-	const M10 = 1;
-	const M11 = 5;
-	const M12 = 9;
-	const M13 = 13;
-	const M20 = 2;
-	const M21 = 6;
-	const M22 = 10;
-	const M23 = 14;
-	const M30 = 3;
-	const M31 = 7;
-	const M32 = 11;
-	const M33 = 15;
+	const M00: number;
+	const M01: number;
+	const M02: number;
+	const M03: number;
+	const M10: number;
+	const M11: number;
+	const M12: number;
+	const M13: number;
+	const M20: number;
+	const M21: number;
+	const M22: number;
+	const M23: number;
+	const M30: number;
+	const M31: number;
+	const M32: number;
+	const M33: number;
 	class Matrix4 {
 	class Matrix4 {
 		temp: Float32Array;
 		temp: Float32Array;
 		values: Float32Array;
 		values: Float32Array;

Diff do ficheiro suprimidas por serem muito extensas
+ 4007 - 4022
spine-ts/build/spine-widget.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
spine-ts/build/spine-widget.js.map


+ 1 - 1
spine-ts/core/src/Animation.ts

@@ -667,7 +667,7 @@ module spine {
 			let frameVertices = this.frameVertices;
 			let frameVertices = this.frameVertices;
 			let vertexCount = frameVertices[0].length;
 			let vertexCount = frameVertices[0].length;
 
 
-			if (verticesArray.length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.
+			if (verticesArray.length != vertexCount && !setupPose) alpha = 1; // Don't mix from uninitialized slot vertices.
 			let vertices: Array<number> = Utils.setArraySize(verticesArray, vertexCount);
 			let vertices: Array<number> = Utils.setArraySize(verticesArray, vertexCount);
 
 
 			if (time >= frames[frames.length - 1]) { // Time is after last frame.
 			if (time >= frames[frames.length - 1]) { // Time is after last frame.

+ 5 - 2
spine-ts/core/src/AnimationState.ts

@@ -131,16 +131,18 @@ module spine {
 			return false;
 			return false;
 		}
 		}
 
 
-		apply (skeleton: Skeleton) {
+		apply (skeleton: Skeleton) : boolean {
 			if (skeleton == null) throw new Error("skeleton cannot be null.");
 			if (skeleton == null) throw new Error("skeleton cannot be null.");
 			if (this.animationsChanged) this._animationsChanged();
 			if (this.animationsChanged) this._animationsChanged();
 
 
 			let events = this.events;
 			let events = this.events;
 			let tracks = this.tracks;
 			let tracks = this.tracks;
+			let applied = false;
 
 
 			for (let i = 0, n = tracks.length; i < n; i++) {
 			for (let i = 0, n = tracks.length; i < n; i++) {
 				let current = tracks[i];
 				let current = tracks[i];
 				if (current == null || current.delay > 0) continue;
 				if (current == null || current.delay > 0) continue;
+				applied = true;
 
 
 				// Apply mixing from entries first.
 				// Apply mixing from entries first.
 				let mix = current.alpha;
 				let mix = current.alpha;
@@ -179,6 +181,7 @@ module spine {
 			}
 			}
 
 
 			this.queue.drain();
 			this.queue.drain();
+			return applied;
 		}
 		}
 
 
 		applyMixingFrom (to: TrackEntry, skeleton: Skeleton) {
 		applyMixingFrom (to: TrackEntry, skeleton: Skeleton) {
@@ -206,7 +209,7 @@ module spine {
 			let timelinesRotation = from.timelinesRotation;
 			let timelinesRotation = from.timelinesRotation;
 
 
 			let first = false;
 			let first = false;
-			let alphaDip = from.alpha * to.interruptAlpha, alphaMix = alphaDip * (1 - mix), alpha;
+			let alphaDip = from.alpha * to.interruptAlpha, alphaMix = alphaDip * (1 - mix), alpha = 0;
 			from.totalAlpha = 0;
 			from.totalAlpha = 0;
 			for (var i = 0; i < timelineCount; i++) {
 			for (var i = 0; i < timelineCount; i++) {
 				let timeline = timelines[i];
 				let timeline = timelines[i];

+ 1 - 1
spine-ts/core/src/SkeletonJson.ts

@@ -324,7 +324,7 @@ module spine {
 
 
 					let lengths: Array<number> = Utils.newArray(vertexCount / 3, 0);
 					let lengths: Array<number> = Utils.newArray(vertexCount / 3, 0);
 					for (let i = 0; i < map.lengths.length; i++)
 					for (let i = 0; i < map.lengths.length; i++)
-						lengths[i++] = map.lengths[i] * scale;
+						lengths[i] = map.lengths[i] * scale;
 					path.lengths = lengths;
 					path.lengths = lengths;
 
 
 					let color: string = this.getValue(map, "color", null);
 					let color: string = this.getValue(map, "color", null);

+ 68 - 6
spine-unity/Assets/spine-unity/Editor/SpineAttributeDrawers.cs

@@ -60,7 +60,7 @@ namespace Spine.Unity.Editor {
 			noneLabel.image = image;
 			noneLabel.image = image;
 			return noneLabel;
 			return noneLabel;
 		}
 		}
-			
+
 		protected T TargetAttribute { get { return (T)attribute; } }
 		protected T TargetAttribute { get { return (T)attribute; } }
 		protected SerializedProperty SerializedProperty { get; private set; }
 		protected SerializedProperty SerializedProperty { get; private set; }
 
 
@@ -155,7 +155,7 @@ namespace Spine.Unity.Editor {
 			for (int i = 0; i < data.Slots.Count; i++) {
 			for (int i = 0; i < data.Slots.Count; i++) {
 				string name = data.Slots.Items[i].Name;
 				string name = data.Slots.Items[i].Name;
 				if (name.StartsWith(targetAttribute.startsWith, StringComparison.Ordinal)) {
 				if (name.StartsWith(targetAttribute.startsWith, StringComparison.Ordinal)) {
-					
+
 					if (targetAttribute.containsBoundingBoxes) {
 					if (targetAttribute.containsBoundingBoxes) {
 						int slotIndex = i;
 						int slotIndex = i;
 						var attachments = new List<Attachment>();
 						var attachments = new List<Attachment>();
@@ -192,6 +192,28 @@ namespace Spine.Unity.Editor {
 
 
 		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.skin; } }
 		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.skin; } }
 
 
+		public static void GetSkinMenuItems (SkeletonData data, List<string> animationNames, List<GUIContent> menuItems, bool includeNone = true) {
+			if (data == null) return;
+
+			var skins = data.Skins;
+
+			animationNames.Clear();
+			menuItems.Clear();
+
+			var icon = SpineEditorUtilities.Icons.skin;
+
+			if (includeNone) {
+				animationNames.Add("");
+				menuItems.Add(new GUIContent(NoneString, icon));
+			}
+
+			foreach (var s in skins) {
+				var skinName = s.Name;
+				animationNames.Add(skinName);
+				menuItems.Add(new GUIContent(skinName, icon));
+			}
+		}
+
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineSkin targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineSkin targetAttribute, SkeletonData data) {
 			menu.AddDisabledItem(new GUIContent(skeletonDataAsset.name));
 			menu.AddDisabledItem(new GUIContent(skeletonDataAsset.name));
 			menu.AddSeparator("");
 			menu.AddSeparator("");
@@ -207,9 +229,29 @@ namespace Spine.Unity.Editor {
 
 
 	[CustomPropertyDrawer(typeof(SpineAnimation))]
 	[CustomPropertyDrawer(typeof(SpineAnimation))]
 	public class SpineAnimationDrawer : SpineTreeItemDrawerBase<SpineAnimation> {
 	public class SpineAnimationDrawer : SpineTreeItemDrawerBase<SpineAnimation> {
-		
+
 		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.animation; } }
 		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.animation; } }
 
 
+		public static void GetAnimationMenuItems (SkeletonData data, List<string> animationNames, List<GUIContent> menuItems, bool includeNone = true) {
+			if (data == null) return;
+
+			var animations = data.Animations;
+
+			animationNames.Clear();
+			menuItems.Clear();
+
+			if (includeNone) {
+				animationNames.Add("");
+				menuItems.Add(new GUIContent(NoneString, SpineEditorUtilities.Icons.animation));
+			}
+
+			foreach (var a in animations) {
+				var animationName = a.Name;
+				animationNames.Add(animationName);
+				menuItems.Add(new GUIContent(animationName, SpineEditorUtilities.Icons.animation));
+			}
+		}
+
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineAnimation targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineAnimation targetAttribute, SkeletonData data) {
 			var animations = skeletonDataAsset.GetAnimationStateData().SkeletonData.Animations;
 			var animations = skeletonDataAsset.GetAnimationStateData().SkeletonData.Animations;
 
 
@@ -230,6 +272,26 @@ namespace Spine.Unity.Editor {
 
 
 		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.userEvent; } }
 		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.userEvent; } }
 
 
+		public static void GetEventMenuItems (SkeletonData data, List<string> eventNames, List<GUIContent> menuItems, bool includeNone = true) {
+			if (data == null) return;
+
+			var animations = data.Events;
+
+			eventNames.Clear();
+			menuItems.Clear();
+
+			if (includeNone) {
+				eventNames.Add("");
+				menuItems.Add(new GUIContent(NoneString, SpineEditorUtilities.Icons.userEvent));
+			}
+
+			foreach (var a in animations) {
+				var animationName = a.Name;
+				eventNames.Add(animationName);
+				menuItems.Add(new GUIContent(animationName, SpineEditorUtilities.Icons.userEvent));
+			}
+		}
+
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineEvent targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineEvent targetAttribute, SkeletonData data) {
 			var events = skeletonDataAsset.GetSkeletonData(false).Events;
 			var events = skeletonDataAsset.GetSkeletonData(false).Events;
 
 
@@ -325,7 +387,7 @@ namespace Spine.Unity.Editor {
 					validSkins.Add(currentSkin);
 					validSkins.Add(currentSkin);
 				else
 				else
 					validSkins.Add(data.Skins.Items[0]);
 					validSkins.Add(data.Skins.Items[0]);
-					
+
 			} else {
 			} else {
 				foreach (Skin skin in data.Skins)
 				foreach (Skin skin in data.Skins)
 					if (skin != null) validSkins.Add(skin);
 					if (skin != null) validSkins.Add(skin);
@@ -398,7 +460,7 @@ namespace Spine.Unity.Editor {
 
 
 	[CustomPropertyDrawer(typeof(SpineBone))]
 	[CustomPropertyDrawer(typeof(SpineBone))]
 	public class SpineBoneDrawer : SpineTreeItemDrawerBase<SpineBone> {
 	public class SpineBoneDrawer : SpineTreeItemDrawerBase<SpineBone> {
-		
+
 		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.bone; } }
 		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.bone; } }
 
 
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineBone targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineBone targetAttribute, SkeletonData data) {
@@ -428,7 +490,7 @@ namespace Spine.Unity.Editor {
 				EditorGUI.LabelField(position, "ERROR:", "May only apply to type string");
 				EditorGUI.LabelField(position, "ERROR:", "May only apply to type string");
 				return;
 				return;
 			}
 			}
-				
+
 			string atlasAssetFieldName = TargetAttribute.atlasAssetField;
 			string atlasAssetFieldName = TargetAttribute.atlasAssetField;
 			if (string.IsNullOrEmpty(atlasAssetFieldName))
 			if (string.IsNullOrEmpty(atlasAssetFieldName))
 				atlasAssetFieldName = "atlasAsset";
 				atlasAssetFieldName = "atlasAsset";

+ 1 - 1
spine-unity/Assets/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs

@@ -196,7 +196,7 @@ namespace Spine.Unity.Editor {
 			graphic.MeshGenerator.settings.zSpacing = SpineEditorUtilities.defaultZSpacing;
 			graphic.MeshGenerator.settings.zSpacing = SpineEditorUtilities.defaultZSpacing;
 
 
 			graphic.Initialize(false);
 			graphic.Initialize(false);
-			graphic.Skeleton.SetSkin(skin);
+			if (skin != null) graphic.Skeleton.SetSkin(skin);
 			graphic.initialSkinName = skin.Name;
 			graphic.initialSkinName = skin.Name;
 			graphic.Skeleton.UpdateWorldTransform();
 			graphic.Skeleton.UpdateWorldTransform();
 			graphic.UpdateMesh();
 			graphic.UpdateMesh();

+ 9 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: dfdd78a071ca1a04bb64c6cc41e14aa0
+folderAsset: yes
+timeCreated: 1496447038
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 9 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Editor.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 1ad4318c20ec5674a9f4d7f786afd681
+folderAsset: yes
+timeCreated: 1496449217
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 47 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Editor/SlotBlendModesEditor.cs

@@ -0,0 +1,47 @@
+/******************************************************************************
+ * Spine Runtimes Software License v2.5
+ *
+ * Copyright (c) 2013-2016, Esoteric Software
+ * All rights reserved.
+ *
+ * You are granted a perpetual, non-exclusive, non-sublicensable, and
+ * non-transferable license to use, install, execute, and perform the Spine
+ * Runtimes software and derivative works solely for personal or internal
+ * use. Without the written permission of Esoteric Software (see Section 2 of
+ * the Spine Software License Agreement), you may not (a) modify, translate,
+ * adapt, or develop new applications using the Spine Runtimes or otherwise
+ * create derivative works or improvements of the Spine Runtimes or (b) remove,
+ * delete, alter, or obscure any trademarks or any copyright, trademark, patent,
+ * or other intellectual property or proprietary rights notices on or in the
+ * Software, including any copy thereof. Redistributions in binary or source
+ * form must include this license and terms.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
+ * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+using UnityEngine;
+using UnityEditor;
+using Spine.Unity.Modules;
+
+namespace Spine.Unity.Editor {
+	using Editor = UnityEditor.Editor;
+
+	public class SlotBlendModesEditor : Editor {
+		
+		[MenuItem("CONTEXT/SkeletonRenderer/Add Slot Blend Modes Component")]
+		static void AddSlotBlendModesComponent (MenuCommand command) {
+			var skeletonRenderer = (SkeletonRenderer)command.context;
+			skeletonRenderer.gameObject.AddComponent<SlotBlendModes>();
+		}
+	}
+}
+

+ 12 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Editor/SlotBlendModesEditor.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: cbec7dc66dca80a419477536c23b7a0d
+timeCreated: 1496449255
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 43 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SkeletonPMAMultiply.mat

@@ -0,0 +1,43 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: SkeletonPMAMultiply
+  m_Shader: {fileID: 4800000, guid: 8bdcdc7ee298e594a9c20c61d25c33b6, type: 3}
+  m_ShaderKeywords: 
+  m_LightmapFlags: 4
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  m_SavedProperties:
+    serializedVersion: 2
+    m_TexEnvs:
+    - first:
+        name: <noninit>
+      second:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - first:
+        name: _MainTex
+      second:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Floats:
+    - first:
+        name: <noninit>
+      second: 0
+    - first:
+        name: _Cutoff
+      second: 0.1
+    m_Colors:
+    - first:
+        name: <noninit>
+      second: {r: 0, g: 2.018574, b: 1e-45, a: 0.000007110106}
+    - first:
+        name: _Color
+      second: {r: 1, g: 1, b: 1, a: 1}

+ 9 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SkeletonPMAMultiply.mat.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 53bf0ab317d032d418cf1252d68f51df
+timeCreated: 1496447909
+licenseType: Free
+NativeFormatImporter:
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 43 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SkeletonPMAScreen.mat

@@ -0,0 +1,43 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: SkeletonPMAScreen
+  m_Shader: {fileID: 4800000, guid: 4e8caa36c07aacf4ab270da00784e4d9, type: 3}
+  m_ShaderKeywords: 
+  m_LightmapFlags: 4
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  m_SavedProperties:
+    serializedVersion: 2
+    m_TexEnvs:
+    - first:
+        name: <noninit>
+      second:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - first:
+        name: _MainTex
+      second:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Floats:
+    - first:
+        name: <noninit>
+      second: 0
+    - first:
+        name: _Cutoff
+      second: 0.1
+    m_Colors:
+    - first:
+        name: <noninit>
+      second: {r: 0, g: 2.018574, b: 1e-45, a: 0.000007121922}
+    - first:
+        name: _Color
+      second: {r: 1, g: 1, b: 1, a: 1}

+ 9 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SkeletonPMAScreen.mat.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 73f0f46d3177c614baf0fa48d646a9be
+timeCreated: 1496447909
+licenseType: Free
+NativeFormatImporter:
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 152 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs

@@ -0,0 +1,152 @@
+/******************************************************************************
+ * Spine Runtimes Software License v2.5
+ *
+ * Copyright (c) 2013-2016, Esoteric Software
+ * All rights reserved.
+ *
+ * You are granted a perpetual, non-exclusive, non-sublicensable, and
+ * non-transferable license to use, install, execute, and perform the Spine
+ * Runtimes software and derivative works solely for personal or internal
+ * use. Without the written permission of Esoteric Software (see Section 2 of
+ * the Spine Software License Agreement), you may not (a) modify, translate,
+ * adapt, or develop new applications using the Spine Runtimes or otherwise
+ * create derivative works or improvements of the Spine Runtimes or (b) remove,
+ * delete, alter, or obscure any trademarks or any copyright, trademark, patent,
+ * or other intellectual property or proprietary rights notices on or in the
+ * Software, including any copy thereof. Redistributions in binary or source
+ * form must include this license and terms.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF
+ * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Spine.Unity.Modules {
+
+	[DisallowMultipleComponent]
+	public class SlotBlendModes : MonoBehaviour {
+
+		#region Internal Material Dictionary
+		public struct MaterialTexturePair {
+			public Texture2D texture2D;
+			public Material material;
+		}
+
+		static Dictionary<MaterialTexturePair, Material> materialTable;
+		internal static Dictionary<MaterialTexturePair, Material> MaterialTable {
+			get {
+				if (materialTable == null) materialTable = new Dictionary<MaterialTexturePair, Material>();
+				return materialTable;
+			}
+		}
+
+		internal static Material GetMaterialFor (Material materialSource, Texture2D texture) {
+			if (materialSource == null || texture == null) return null;
+
+			var mt = SlotBlendModes.MaterialTable;
+			Material m;
+			var key = new MaterialTexturePair {	material = materialSource, texture2D = texture };
+			if (!mt.TryGetValue(key, out m)) {
+				m = new Material(materialSource);
+				m.name = "(Clone)" + texture.name + "-" + materialSource.name;
+				m.mainTexture = texture;
+				mt[key] = m;
+			}
+
+			return m;
+		}
+		#endregion
+
+		#region Inspector
+		public Material multiplyMaterialSource;
+		public Material screenMaterialSource;
+
+		Texture2D texture;
+		#endregion
+
+		public bool Applied { get; private set; }
+
+		void Start () {
+			if (!Applied) Apply();
+		}
+
+		void OnDestroy () {
+			if (Applied) Remove();
+		}
+
+		public void Apply () {
+			GetTexture();
+			if (texture == null) return;
+
+			var skeletonRenderer = GetComponent<SkeletonRenderer>();
+			if (skeletonRenderer == null) return;
+
+			var slotMaterials = skeletonRenderer.CustomSlotMaterials;
+
+			foreach (var s in skeletonRenderer.Skeleton.Slots) {
+				switch (s.data.blendMode) {
+				case BlendMode.Multiply:
+					if (multiplyMaterialSource != null) slotMaterials[s] = GetMaterialFor(multiplyMaterialSource, texture);
+					break;
+				case BlendMode.Screen:
+					if (screenMaterialSource != null) slotMaterials[s] = GetMaterialFor(screenMaterialSource, texture);
+					break;
+				}
+			}
+
+			Applied = true;
+			skeletonRenderer.LateUpdate();
+		}
+
+		public void Remove () {
+			GetTexture();
+			if (texture == null) return;
+
+			var skeletonRenderer = GetComponent<SkeletonRenderer>();
+			if (skeletonRenderer == null) return;
+
+			var slotMaterials = skeletonRenderer.CustomSlotMaterials;
+
+			foreach (var s in skeletonRenderer.Skeleton.Slots) {
+				Material m = null;
+
+				switch (s.data.blendMode) {
+				case BlendMode.Multiply:
+					if (slotMaterials.TryGetValue(s, out m) && Material.ReferenceEquals(m, GetMaterialFor(multiplyMaterialSource, texture)))
+						slotMaterials.Remove(s);
+					break;
+				case BlendMode.Screen:
+					if (slotMaterials.TryGetValue(s, out m) && Material.ReferenceEquals(m, GetMaterialFor(screenMaterialSource, texture)))
+						slotMaterials.Remove(s);
+					break;
+				}
+			}
+
+			Applied = false;
+			skeletonRenderer.LateUpdate();
+		}
+
+		public void GetTexture () {
+			if (texture == null) {
+				var sr = GetComponent<SkeletonRenderer>(); if (sr == null) return;
+				var sda = sr.skeletonDataAsset; if (sda == null) return;
+				var aa = sda.atlasAssets[0]; if (aa == null) return;
+				var am = aa.materials[0]; if (am == null) return;
+				texture = am.mainTexture as Texture2D;
+			}
+		}
+
+
+	}
+}
+

+ 16 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs.meta

@@ -0,0 +1,16 @@
+fileFormatVersion: 2
+guid: f1f8243645ba2e74aa3564bd956eed89
+timeCreated: 1496794038
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences:
+  - multiplyMaterialSource: {fileID: 2100000, guid: 53bf0ab317d032d418cf1252d68f51df,
+      type: 2}
+  - screenMaterialSource: {fileID: 2100000, guid: 73f0f46d3177c614baf0fa48d646a9be,
+      type: 2}
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 101 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Spine-Skeleton-PMA-Multiply.shader

@@ -0,0 +1,101 @@
+// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
+
+// Spine/Skeleton PMA Multiply
+// - single color multiply tint
+// - unlit
+// - Premultiplied alpha Multiply blending
+// - No depth, no backface culling, no fog.
+// - ShadowCaster pass
+
+Shader "Spine/Skeleton PMA Multiply" {
+	Properties {
+		_Color ("Tint Color", Color) = (1,1,1,1)
+		[NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {}
+		_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
+	}
+
+	SubShader {
+		Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
+		LOD 100
+
+		Fog { Mode Off }
+		Cull Off
+		ZWrite Off
+		Blend DstColor OneMinusSrcAlpha
+		Lighting Off
+
+		Pass {
+			CGPROGRAM
+			#pragma vertex vert
+			#pragma fragment frag
+			#include "UnityCG.cginc"
+			uniform sampler2D _MainTex;
+			uniform float4 _Color;
+
+			struct VertexInput {
+				float4 vertex : POSITION;
+				float2 uv : TEXCOORD0;
+				float4 vertexColor : COLOR;
+			};
+
+			struct VertexOutput {
+				float4 pos : SV_POSITION;
+				float2 uv : TEXCOORD0;
+				float4 vertexColor : COLOR;
+			};
+
+			VertexOutput vert (VertexInput v) {
+				VertexOutput o;
+				o.pos = UnityObjectToClipPos(v.vertex);
+				o.uv = v.uv;
+				o.vertexColor = v.vertexColor * float4(_Color.rgb * _Color.a, _Color.a); // Combine a PMA version of _Color with vertexColor.
+				return o;
+			}
+
+			float4 frag (VertexOutput i) : COLOR {
+				float4 texColor = tex2D(_MainTex, i.uv);
+				return (texColor * i.vertexColor);
+			}
+			ENDCG
+		}
+
+		Pass {
+			Name "Caster"
+			Tags { "LightMode"="ShadowCaster" }
+			Offset 1, 1
+
+			ZWrite On
+			ZTest LEqual
+
+			CGPROGRAM
+			#pragma vertex vert
+			#pragma fragment frag
+			#pragma multi_compile_shadowcaster
+			#pragma fragmentoption ARB_precision_hint_fastest
+			#include "UnityCG.cginc"
+			struct v2f { 
+				V2F_SHADOW_CASTER;
+				float2 uv : TEXCOORD1;
+			};
+
+			uniform float4 _MainTex_ST;
+
+			v2f vert (appdata_base v) {
+				v2f o;
+				TRANSFER_SHADOW_CASTER(o)
+				o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
+				return o;
+			}
+
+			uniform sampler2D _MainTex;
+			uniform fixed _Cutoff;
+
+			float4 frag (v2f i) : COLOR {
+				fixed4 texcol = tex2D(_MainTex, i.uv);
+				clip(texcol.a - _Cutoff);
+				SHADOW_CASTER_FRAGMENT(i)
+			}
+			ENDCG
+		}
+	}
+}

+ 9 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Spine-Skeleton-PMA-Multiply.shader.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 8bdcdc7ee298e594a9c20c61d25c33b6
+timeCreated: 1496446742
+licenseType: Free
+ShaderImporter:
+  defaultTextures: []
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 99 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Spine-Skeleton-PMA-Screen.shader

@@ -0,0 +1,99 @@
+// Spine/Skeleton PMA Multiply
+// - single color multiply tint
+// - unlit
+// - Premultiplied alpha Multiply blending
+// - No depth, no backface culling, no fog.
+// - ShadowCaster pass
+
+Shader "Spine/Skeleton PMA Screen" {
+	Properties {
+		_Color ("Tint Color", Color) = (1,1,1,1)
+		[NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {}
+		_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
+	}
+
+	SubShader {
+		Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
+		LOD 100
+
+		Fog { Mode Off }
+		Cull Off
+		ZWrite Off
+		Blend One OneMinusSrcColor
+		Lighting Off
+
+		Pass {
+			CGPROGRAM
+			#pragma vertex vert
+			#pragma fragment frag
+			#include "UnityCG.cginc"
+			uniform sampler2D _MainTex;
+			uniform float4 _Color;
+
+			struct VertexInput {
+				float4 vertex : POSITION;
+				float2 uv : TEXCOORD0;
+				float4 vertexColor : COLOR;
+			};
+
+			struct VertexOutput {
+				float4 pos : SV_POSITION;
+				float2 uv : TEXCOORD0;
+				float4 vertexColor : COLOR;
+			};
+
+			VertexOutput vert (VertexInput v) {
+				VertexOutput o;
+				o.pos = UnityObjectToClipPos(v.vertex);
+				o.uv = v.uv;
+				o.vertexColor = v.vertexColor * float4(_Color.rgb * _Color.a, _Color.a); // Combine a PMA version of _Color with vertexColor.
+				return o;
+			}
+
+			float4 frag (VertexOutput i) : COLOR {
+				float4 texColor = tex2D(_MainTex, i.uv);
+				return (texColor * i.vertexColor);
+			}
+			ENDCG
+		}
+
+		Pass {
+			Name "Caster"
+			Tags { "LightMode"="ShadowCaster" }
+			Offset 1, 1
+
+			ZWrite On
+			ZTest LEqual
+
+			CGPROGRAM
+			#pragma vertex vert
+			#pragma fragment frag
+			#pragma multi_compile_shadowcaster
+			#pragma fragmentoption ARB_precision_hint_fastest
+			#include "UnityCG.cginc"
+			struct v2f { 
+				V2F_SHADOW_CASTER;
+				float2 uv : TEXCOORD1;
+			};
+
+			uniform float4 _MainTex_ST;
+
+			v2f vert (appdata_base v) {
+				v2f o;
+				TRANSFER_SHADOW_CASTER(o)
+				o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
+				return o;
+			}
+
+			uniform sampler2D _MainTex;
+			uniform fixed _Cutoff;
+
+			float4 frag (v2f i) : COLOR {
+				fixed4 texcol = tex2D(_MainTex, i.uv);
+				clip(texcol.a - _Cutoff);
+				SHADOW_CASTER_FRAGMENT(i)
+			}
+			ENDCG
+		}
+	}
+}

+ 9 - 0
spine-unity/Assets/spine-unity/Modules/SlotBlendModes/Spine-Skeleton-PMA-Screen.shader.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 4e8caa36c07aacf4ab270da00784e4d9
+timeCreated: 1496448787
+licenseType: Free
+ShaderImporter:
+  defaultTextures: []
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff