[ISSUE]Lambda binding for lua is not supported.

环境: cocos2d-x + lua 3.0beta2

想使用CCNotification, 发现3.0已经替换为CCEvent, 晃了一眼设计,不错

原来在C++ 上自己也实现了一套Event,因为不满意CCNotification
没有优先级,没有自定义分类(比如UI,Logic),不能携带数据,现在3.0的设计基本满足了需求

使用中还是发现一点问题 (self is a CCLayer):

self:getEventDispatcher():addCustomEventListener(EVENT_XXX, function()
self:callbackOfXXX() end)

异常:Assertion failed: (false), function
lua_cocos2dx_EventDispatcher_addCustomEventListener /lua_cocos2dx_auto.cpp, line
5610.

暂时没有理解为什么要assert,有空再注释掉试试

临时使用如下方法:


local listener1 = cc.EventListenerCustom:create(EVENT_XXX, function() self:callbackOfXXX() end)
self:getEventDispatcher():addEventListenerWithFixedPriority(listener1, 1)

如题待解。。。

[ISSUE]Lambda binding for lua is not supported.,布布扣,bubuko.com

时间: 2024-11-08 18:30:01

[ISSUE]Lambda binding for lua is not supported.的相关文章

Lua的各种资源1

Libraries And Bindings     LuaDirectory > LuaAddons > LibrariesAndBindings This is a list of libraries implemented in Lua or implemented in another language (e.g. C) but having a Lua interface. For older libraries and bindings, see the LuaAddonsArch

创建C++自定义类让Lua脚本调用

这里将介绍使用tolua++将自定义的C++类嵌入,让lua脚本使用 一般过程: 自定义类 -> 使用tolua++工具编译到LuaCoco2d.cpp中 -> lua调用 步骤一:自定义一个C++类,我定义一个类名为:MySprite MySprite.h MySprite.cpp 步骤二:根据自定义类创建一个.pkg文件,我们把自定义的MySprite类定义到.pkg文件中 注意:1>,只要根据自定类.h中的内容,至于.cpp的实现,binding后lua会自动调用类的函数 2>

所有的GUI Toolkit,类型之多真开眼界

The GUI Toolkit, Framework Page User interfaces occupy an important part of software development. This page provides a comprehensive reference on toolkits for building graphical user interfaces (GUIs), with emphasis on resources for Free Software (Op

Menu的自定义实现-------保卫萝卜造塔升级塔菜单实现

cocos2dx原生的menu排版函数实现的很无完整,像最基本的Item的排序要想做得稍微漂亮一些就需要我们自己实现. 对于Menu我们可以用两种方法来实现: 1.大神级别. 继承自Control,自己来封装新的Menu类,要求我们能够友好的去抽象定义基类. 2.半仙级别.修改MenuItem的函数或者重写一套对于Item的排序函数.做到自己想要的排版. 3.菜鸟级别.继承自Node,在Node中添加成员变量Menu,针对不同的UI设置Item的位置和动画. 这里解析一下第三种方法,第一种方法确

【COCOS2D-X 备注篇】ASSETMANAGEREX使用异常解决备注->CHECK_JNI/CC‘JAVA.LANG.NOCLASSDEFFOUNDERROR’

本站文章均为李华明Himi原创,转载务必在明显处注明:(作者新浪微博:@李华明Himi) 转载自[黑米GameDev街区] 原文链接: check_jni.cc JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception 'java.lang.NoClassDefFoundError' thrown in unknown throw location>http://www.himigame.c

cocod2d-x 之 CCDirector、CCScene、CCSprite

CCDirector是控制游戏流程的主要组件. 1 typedef enum { 2 /// sets a 2D projection (orthogonal projection)2D投机模式 3 kCCDirectorProjection2D, 4 5 /// sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.3D投影 6 kCCDirectorProjection3D, 7 8 /// it calls "updat

awesome-modern-cpp

Awesome Modern C++ A collection of resources on modern C++. The goal is to collect a list of resouces to help people learn about and leverage modern C++11 and beyond. Contributing To add, remove or change things on the list: please submit a pull requ

Python3.7 exe编译工具对比zz

For years, NVDA has used Py2exe to package Python code into something that is executable on a system that doesn't have Python installed. For Python 2.7, we have been at Py2exe 0.6.9 (introduced in 2008) for a long time. For Python 3, a new version ha

Cocos2d-x 3.1 Lua Binding

Cocos2d-x 3.1 Lua Binding 参考:http://www.cocos2d-x.org/docs/manual/code-ide/binding-custom-class-to-lua/en 添加需要绑定的C++类 在xcode中,把my文件夹拖到cocos2d_libs.xcodeproj中 HNLuaTest.h // // HNLuaTest.h // cocos2d_libs // // Created by Eleven Chen on 14-8-5. // //