From dd070e177e9098ae8ffc35b3e80ef711a233c0bc Mon Sep 17 00:00:00 2001 From: yangxiao Date: Fri, 27 Feb 2015 10:20:32 +0800 Subject: [PATCH] modify unproject --- .../manual/cocos2d/lua_cocos2dx_manual.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp index 6a08b48200..f24d372f1b 100644 --- a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp @@ -7266,6 +7266,20 @@ int lua_cocos2dx_Camera_unproject(lua_State* tolua_S) #endif argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vec3 arg0; + + ok &= luaval_to_vec3(tolua_S, 2, &arg0, "cc.Camera:project"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_project'", nullptr); + return 0; + } + auto ret = cobj->unproject(arg0); + vec3_to_luaval(tolua_S, ret); + return 1; + } if (argc == 3) { cocos2d::Size arg0;