Index: nacltoons/data/res/util.lua |
diff --git a/nacltoons/data/res/util.lua b/nacltoons/data/res/util.lua |
index 0997161c7f6b54362a1d3f06730fd4cbdeeb47ba..75f4a47e5735411784c21e293d74bbf4509f8f7f 100644 |
--- a/nacltoons/data/res/util.lua |
+++ b/nacltoons/data/res/util.lua |
@@ -31,8 +31,12 @@ end |
--- Create CCPoint from a lua table containing 2 elements. |
-- This is used to convert point data from .def files into |
-- the cocos2dx coordinate space. |
-function util.PointFromLua(point) |
- return CCPointMake(point[1] + game_obj.origin.x, point[2] + game_obj.origin.y) |
+function util.PointFromLua(point, relative) |
+ if relative then |
+ return ccp(point[1], point[2]) |
+ else |
+ return ccp(point[1] + game_obj.origin.x, point[2] + game_obj.origin.y) |
+ end |
end |
--- Convert CCPoint to b2Vec. |
@@ -206,7 +210,6 @@ function util.TableToString(tt, ignore_keys, key_map, indent) |
table.insert(sb, string.rep (' ', indent - 2)) |
table.insert(sb, '}\n') |
return table.concat(sb) |
- |
end |
return util |