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

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
« no previous file with comments | « nacltoons/data/res/touch_handler.lua ('k') | nacltoons/data/res/validate.lua » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nacltoons/data/res/util.lua
diff --git a/nacltoons/data/res/util.lua b/nacltoons/data/res/util.lua
index 0997161c7f6b54362a1d3f06730fd4cbdeeb47ba..31efc690a275ce1a576e46fd271e08eeb0809423 100644
--- a/nacltoons/data/res/util.lua
+++ b/nacltoons/data/res/util.lua
@@ -31,8 +31,15 @@ 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, absolute)
+ if absolute == nil then
+ absolute = true
+ end
+ if abolute then
+ return ccp(point[1] + game_obj.origin.x, point[2] + game_obj.origin.y)
+ else
+ return ccp(point[1], point[2])
+ end
end
--- Convert CCPoint to b2Vec.
@@ -206,7 +213,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
« no previous file with comments | « nacltoons/data/res/touch_handler.lua ('k') | nacltoons/data/res/validate.lua » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698