From 9ffb689b495e63353c832c8d5e5ff8725ed88d0a Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sat, 17 Aug 2013 12:25:58 +0200 Subject: [PATCH] Warning for nonuniform scaling in Corona. --- spine-corona/spine-corona/spine.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spine-corona/spine-corona/spine.lua b/spine-corona/spine-corona/spine.lua index c90809139..b84e7fc95 100644 --- a/spine-corona/spine-corona/spine.lua +++ b/spine-corona/spine-corona/spine.lua @@ -116,12 +116,16 @@ function spine.Skeleton.new (skeletonData, group) image.rotation = -(slot.bone.worldRotation + attachment.rotation) -- fix scaling when attachment is rotated 90 degrees - local rot = math.abs(attachment.rotation) % 180 - if (rot == 90) then + local rotation = math.abs(attachment.rotation) % 180 + if (rotation == 90) then image.xScale = slot.bone.worldScaleY * attachment.scaleX image.yScale = slot.bone.worldScaleX * attachment.scaleY else - --if (rot ~= 0 and (slot.bone.worldScaleX ~= 1 or slot.bone.worldScaleY ~= 1)) then print("WARNING: Scaling bones with attachments not rotated to the cardinal angles will not work as expected in Corona!") end + if (rotation ~= 0 and (slot.bone.worldScaleX ~= 1 or slot.bone.worldScaleY ~= 1)) then + print("WARNING: Non-uniform bone scaling with attachments not rotated to\n" + .." cardinal angles will not work as expected with Corona.\n" + .." Bone: "..slot.bone.data.name..", slot: "..slot.data.name..", attachment: "..attachment.name) + end image.xScale = slot.bone.worldScaleX * attachment.scaleX image.yScale = slot.bone.worldScaleY * attachment.scaleY end