本文共 651 字,大约阅读时间需要 2 分钟。
在windows 7下 1、在Classes目录下自定义c++类 2、在cocos2d-x-2.2\tools\tolua++文件夹中添加自定义类的.pkg文件 自定义类的.pkg文件的书写规则 1) enum keeps the same 2) remove CC_DLL for the class defines, pay attention to multi inherites 3) remove inline keyword for declaration and implementation 4) remove public protect and private 5) remove the decalration of class member variable 6) keep static keyword 7) remove memeber functions that declared as private or protected 3、在cocos2d-x-2.2\tools\tolua++文件夹中解压tolua++.rar将tolua++.exe取出放在cocos2d-x-2.2\tools\tolua++目录下 4、将我们自定义类的.pkg文件注册到 cocos2d-x-2.2\tools\tolua++文件夹下的Cocos2d.pkg(打开该文件依葫芦画瓢) 5.cmd cd到cocos2d-x-2.2\tools\tolua++目录,执行build.bat转载地址:http://vttgi.baihongyu.com/