Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: nacltoons/data/res/util.lua

Issue 15070003: [nacltoons] Add compound shapes. (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698