1. fix ccui.Widget:hitTest() lua不需要第3个参数。 2. NodeEx.lua的触摸事件点击只调用Node的hitTest,避免使用ccui.Widget的。3. lua搜索路径去掉系统路径。

This commit is contained in:
u0u0
2020-03-16 20:44:14 +08:00
parent 32295b723f
commit fd0db28d66
4 changed files with 8 additions and 14 deletions

View File

@@ -3127,27 +3127,21 @@ int lua_cocos2dx_ui_Widget_hitTest(lua_State* tolua_S)
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 3)
if (argc == 2)
{
cocos2d::Vec2 arg0;
const cocos2d::Camera* arg1;
cocos2d::Vec3* arg2;
ok &= luaval_to_vec2(tolua_S, 2, &arg0, "ccui.Widget:hitTest");
ok &= luaval_to_object<const cocos2d::Camera>(tolua_S, 3, "cc.Camera",&arg1, "ccui.Widget:hitTest");
ok &= luaval_to_object<cocos2d::Vec3>(tolua_S, 4, "cc.Vec3",&arg2, "ccui.Widget:hitTest");
if(!ok)
{
if (!ok) {
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Widget_hitTest'", nullptr);
return 0;
}
bool ret = cobj->hitTest(arg0, arg1, arg2);
bool ret = cobj->hitTest(arg0, arg1, nullptr);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Widget:hitTest",argc, 3);
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Widget:hitTest",argc, 2);
return 0;
#if COCOS2D_DEBUG >= 1