setLastFrameCallFunc接口不能使用解决方案
来源:互联网 发布:菲律宾网络诈骗 编辑:程序博客网 时间:2024/06/10 17:34
原因:c++的接口已经实现了 但是未完成lua接口的导出
解决方案
1.打开lua_cocos2dx_coco_studio_manual.cpp文件
2.找到setFrameEventCallFunc函数的实现方法
3.仿照该方法实现setLastFrameCallFunc
具体如下:
1.在staticvoid extendActionTimeline(lua_State* L) 下增加一行代码
tolua_function(L, "setFrameEventCallFunc",lua_cocos2dx_ActionTimeline_setFrameEventCallFunc);
tolua_function(L, "setLastFrameCallFunc",lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc);
2.增加实现
static int lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc(lua_State* tolua_S){ int argc = 0; cocostudio::timeline::ActionTimeline* cobj =nullptr; // bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err;#endif #if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err))goto tolua_lerror;#endif cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc'",nullptr); return 0; }#endif argc = lua_gettop(tolua_S) - 1; if (1 == argc) {#if COCOS2D_DEBUG >= 1 if (!toluafix_isfunction(tolua_S,2,"LUA_FUNCTION",0,&tolua_err) ) { goto tolua_lerror; }#endif LUA_FUNCTION handler = ( toluafix_ref_function(tolua_S,2,0)); cobj->setLastFrameCallFunc([=](){ LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler,0); }); return 0; } luaL_error(tolua_S,"'setFrameEventCallFunc' function of ActionTimeline has wrong number of arguments: %d, was expecting %d\n", argc,1); #if COCOS2D_DEBUG >= 1tolua_lerror: tolua_error(tolua_S,"#ferror in function 'setFrameEventCallFunc'.",&tolua_err);#endif return 0;}
1 0
- setLastFrameCallFunc接口不能使用解决方案
- cocos2dx 3.x中ActionTimeLine无法使用setLastFrameCallFunc的解决方案
- 微信公众号开发使用测试号不能测试支付接口的解决方案
- 微信公众号开发使用测试号不能测试支付接口的解决方案
- 微信公众号开发使用测试号不能测试支付接口的解决方案
- outlook2007 菜单灰色...不能使用的解决方案
- RedHat中ifconfig命令不能使用解决方案
- linux不能使用sudo命令解决方案
- Xcode7.1不能使用Alcatraz解决方案
- GenyMotion 在Win10上不能使用解决方案
- Win10不能使用Genymotion模拟器的解决方案
- S7 edge更新后侧屏不能使用解决方案
- cocos2dx ActionTimeline setLastFrameCallFunc
- USB接口键盘不能使用故障解决办法
- usb 接口突然不能使用了怎么办?
- 微信开发 分享接口不能使用
- C#接口介绍-接口为什么不能使用委托
- vue在使用vuex时遇到...mapGetter不能使用解决方案
- 设计原则之迪米特法则
- Correspondence analysis application
- iOS 学习(深拷贝 浅拷贝)
- 搜索字符串strstr()函数
- Fresco通过后处理器(Postprocessor)生成仿skype字母和背景色的头像
- setLastFrameCallFunc接口不能使用解决方案
- scrollTo与scrollBy
- mysql新增授权给特定IP访问的用户
- C++学习:字符串分割函数
- JavaScript总结
- 算法导论12.2-8 二叉搜索树的非递归遍历先驱节点分析
- PHP SPL 数据结构笔记摘要
- Android中设置控件透明度的方法
- 加一行,减一行