From 09ff781a9ac68d4ede4cc05b9cea4568b04a9654 Mon Sep 17 00:00:00 2001 From: Matias Date: Tue, 28 May 2013 20:43:11 +0300 Subject: [PATCH] Add Lua support for reading scale and rotation inheritance --- spine-lua/SkeletonJson.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spine-lua/SkeletonJson.lua b/spine-lua/SkeletonJson.lua index f14f0500d..a837ceb13 100644 --- a/spine-lua/SkeletonJson.lua +++ b/spine-lua/SkeletonJson.lua @@ -75,6 +75,10 @@ function SkeletonJson.new (attachmentLoader) boneData.rotation = (boneMap["rotation"] or 0) boneData.scaleX = (boneMap["scaleX"] or 1) boneData.scaleY = (boneMap["scaleY"] or 1) + -- typical 'value or default' will not work here, as in practice the possible values are 'false' or nil, + -- both of which evaluate to false and the default value is true + if boneMap["inheritScale"] == false then boneData.inheritScale = false else boneData.inheritScale = true end + if boneMap["inheritRotation"] == false then boneData.inheritRotation = false else boneData.inheritRotation = true end table.insert(skeletonData.bones, boneData) end