From 9e2c58873412654c3a518647cce4f9747df7d683 Mon Sep 17 00:00:00 2001 From: smaren Date: Thu, 8 May 2014 11:19:05 +0200 Subject: [PATCH 1/4] fixed skeletons setAttachment using getAttachment getAttachment does not exist, now uses getAttachmentBySlotIndex --- spine-js/spine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-js/spine.js b/spine-js/spine.js index 4330330fb..5c8fd5307 100644 --- a/spine-js/spine.js +++ b/spine-js/spine.js @@ -776,7 +776,7 @@ spine.Skeleton.prototype = { if (slot.data.name == slotName) { var attachment = null; if (attachmentName) { - attachment = this.getAttachment(i, attachmentName); + attachment = this.getAttachmentBySlotIndex(i, attachmentName); if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; } slot.setAttachment(attachment); From 2715e2409fd2db16ffa1e05e57cf0fdb48c1c0a7 Mon Sep 17 00:00:00 2001 From: smaren Date: Thu, 8 May 2014 11:20:11 +0200 Subject: [PATCH 2/4] fixed boundingbox typo BoundingBox was boundingbox and boundingBox different places, now it is boundingBox everywhere --- spine-js/spine.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-js/spine.js b/spine-js/spine.js index 5c8fd5307..26d0f1608 100644 --- a/spine-js/spine.js +++ b/spine-js/spine.js @@ -810,7 +810,7 @@ spine.Event.prototype = { spine.AttachmentType = { region: 0, - boundingbox: 1 + boundingBox: 1 }; spine.RegionAttachment = function (name) { @@ -1645,7 +1645,7 @@ spine.AtlasAttachmentLoader = function (atlas) { spine.AtlasAttachmentLoader.prototype = { newAttachment: function (skin, type, name) { switch (type) { - case spine.AttachmentType.boundingbox: + case spine.AttachmentType.boundingBox: return new spine.BoundingBoxAttachment(name); case spine.AttachmentType.region: var region = this.atlas.findRegion(name); From 564025d9553c2332109c39c87e9aa445140d01aa Mon Sep 17 00:00:00 2001 From: smaren Date: Thu, 8 May 2014 12:10:01 +0200 Subject: [PATCH 3/4] Revert "fixed boundingbox typo" This reverts commit 2715e2409fd2db16ffa1e05e57cf0fdb48c1c0a7. --- spine-js/spine.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-js/spine.js b/spine-js/spine.js index 26d0f1608..5c8fd5307 100644 --- a/spine-js/spine.js +++ b/spine-js/spine.js @@ -810,7 +810,7 @@ spine.Event.prototype = { spine.AttachmentType = { region: 0, - boundingBox: 1 + boundingbox: 1 }; spine.RegionAttachment = function (name) { @@ -1645,7 +1645,7 @@ spine.AtlasAttachmentLoader = function (atlas) { spine.AtlasAttachmentLoader.prototype = { newAttachment: function (skin, type, name) { switch (type) { - case spine.AttachmentType.boundingBox: + case spine.AttachmentType.boundingbox: return new spine.BoundingBoxAttachment(name); case spine.AttachmentType.region: var region = this.atlas.findRegion(name); From 4865f288f34900a2febc49b715b88d2b2b1663d1 Mon Sep 17 00:00:00 2001 From: smaren Date: Thu, 8 May 2014 12:13:25 +0200 Subject: [PATCH 4/4] attachment type bounding box should be lower case Fixed all occurences of spine.AttachmentType.boundingBox to be lowercase. --- spine-js/spine.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spine-js/spine.js b/spine-js/spine.js index 5c8fd5307..b0c29b8d5 100644 --- a/spine-js/spine.js +++ b/spine-js/spine.js @@ -904,7 +904,7 @@ spine.BoundingBoxAttachment = function (name) { this.vertices = []; }; spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingBox, + type: spine.AttachmentType.boundingbox, computeWorldVertices: function (x, y, bone, worldVertices) { x += bone.worldX; y += bone.worldY; @@ -1241,7 +1241,7 @@ spine.SkeletonJson.prototype = { attachment.width = (map["width"] || 32) * this.scale; attachment.height = (map["height"] || 32) * this.scale; attachment.updateOffset(); - } else if (type == spine.AttachmentType.boundingBox) { + } else if (type == spine.AttachmentType.boundingbox) { var vertices = map["vertices"]; for (var i = 0, n = vertices.length; i < n; i++) attachment.vertices.push(vertices[i] * this.scale); @@ -1688,7 +1688,7 @@ spine.SkeletonBounds.prototype = { for (var i = 0; i < slotCount; i++) { var slot = slots[i]; var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingBox) continue; + if (boundingBox.type != spine.AttachmentType.boundingbox) continue; boundingBoxes.push(boundingBox); var poolCount = polygonPool.length, polygon;