cocos:C++ 导出到lua, cocos2dx_extension.ini修改

[zq] //zq section, 需要和genbindings.py中的配置相同
# the prefix to be added to the generated functions. You might or might not use this in your own
# templates
//前缀,生成的函数lua_zq_ZQPlistManage_getDictFromFile类似于这样,都有zq
prefix = zq # create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)
# all classes will be embedded in that namespace
//namespace, 类似于cc,在lua中都是zq.ZQPlistManage这样
target_namespace = zq // android_headers 头文件配置,保持不变就行了,androidndkdir
// 我们在genbindings.py中config.set('DEFAULT', 'androidndkdir', ndk_root)
// 保存到userconf.ini中
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include
android_flags = -D_SIZE_T_DEFINED_ // clang 的clang_headers头文件 和 clang_flags参数
clang_headers = -I%(clangllvmdir)s/lib/clang/%(clang_version)s/include
clang_flags = -nostdinc -x c++ -std=c++11 -U __SSE__ // cocos_headers 头文件目录 和 cocos_flags 参数,
// 同样这里cocosdir的也genbindings.py中保存的
cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s/external -I%(cocosdir)s/external/lua/luajit/include -I%(cocosdir)s/external/lua/tolua
cocos_flags = -DANDROID cxxgenerator_headers = // 我们的工程头文件目录
zq_headers = -I%(zqdir)s/libzq -I%(zqdir)s/libzq/libs # extra arguments for clang ,因为tolua是用clang生成的,所以需要配置这些参数
// 给clang
extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(zq_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse
// 需要导出到lua的类的头文件,这里放到了一个头文件中,这个头文件中包含了所有需要导出的
// 类的头文件,当然也可以每个头文件单独写,空格分开
headers = %(zqdir)s/libzq/ZQLibExt.h
// cocos2dx_extension.ini 中的配置
// # what headers to parse
// headers = %(cocosdir)s/extensions/cocos-ext.h
// #include "ExtensionMacros.h"
// #include "GUI/CCControlExtension/CCControlExtensions.h"
// #include "GUI/CCScrollView/CCScrollView.h"
// #include "GUI/CCScrollView/CCTableView.h" # what classes to produce code for. You can use regular expressions here. When testing the regular
# expression, it will be enclosed in "^$", like this: "^Menu*$".
// 导出到lua的C++类,只写需要导出的
classes = ZQLogger ZQFileManage ZQJsonManage ZQPlistManage ZQImageManage DateUtils ZQCustomAction # what should we skip? in the format ClassName::[function function]
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just
# add a single "*" as functions. See bellow for several examples. A special class name is "*", which
# will apply to all class names. This is a convenience wildcard to be able to skip similar named
# functions from all classes. //需要跳过的函数,也就是不需要导出到lua中的函数
skip = ZQFileManage::[getDataFromFile],
DateUtils::[date time],
ZQCustomAction::[registerScriptListener unregisterScriptListener] rename_functions = rename_classes = # for all class names, should we remove something when registering in the target VM?
remove_prefix = # classes for which there will be no "parent" lookup
classes_have_no_parents = # base classes which will be skipped when their sub-classes found them.
base_classes_to_skip = ZQLogger # classes that create no constructor
# Set is special and we will use a hand-written constructor
abstract_classes = # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.
script_control_cpp = no

cocos:C++ 导出到lua, cocos2dx_extension.ini修改的更多相关文章

  1. cocos:C++ 导出到lua, genbindings.py修改

    cocos:C++ 导出到lua, genbindings.py修改 1. 准备 把tools目录下的cocos2dx_extension.ini, genbindings.py, userconf. ...

  2. c++对象导出到lua

    转自:http://www.cnblogs.com/ringofthec/archive/2010/10/26/luabindobj.html 虽然有tolua++, luabind等等, 不过自己手 ...

  3. hiredis异步接口封装并导出到Lua

    hiredis异步接口封装并导出到Lua(金庆的专栏 2017.1)hiredis 不支持 Windows, Windows 下使用 wasppdotorg / hiredis-for-windows ...

  4. eclipse.ini 修改默认编码为 UTF-8

    eclipse.ini 修改默认编码为 UTF-8 打开您的eclipse安装目录,找到eclipse.ini文件 打开eclipse.ini文件,在最下面加入一行代码:-Dfile.encoding ...

  5. cocos2d-x中CCEditbox导出到lua

    自从工作后感觉时间较少(每天工作9-22,晚上就不想动了,早上想多睡点),工作中用的是 cocos2d-x.cocos2d-x是一款手机游戏引擎,虽然支持lua,但和love2d相比非纯lua游戏引 ...

  6. cocos studio UI 1.6.0.0 修改导出项目路径

    因为cocos studio UI 1.6.0.0版本没有自动修改默认导出路径的功能,新建项目后默认导出的路径还是上一个项目的,每次导出都要重新设置路径很麻烦.于是考虑是否可以找到默认配置文件,终于还 ...

  7. cocos进阶教程(1)Lua调用自定义C++类和函数的最佳实践

    第一层:纯C环境下,把C函数注册进Lua环境 a.lua 文件 )) a.c 文件 #include <lua.h> #include <lualib.h> #include ...

  8. php.ini修改php上传文件大小限制的方法详解

    打开php.ini,首先找到file_uploads = on ;是否允许通过HTTP上传文件的开关.默认为ON即是开upload_tmp_dir ;文件上传至服务器上存储临时文件的地方,如果没指定就 ...

  9. 学习cocos code ide 的lua编程

    装上了cocos code ide,配了路径之后,建立一个默认lua工程,发现无法调试,报错. 问了别人,在cocos2dconstants.lua的613行插入cc.AsyncTaskPool  = ...

随机推荐

  1. sql server取日期各个组成部分的datename()函数

    SQL Server中的日期类型datetime的默认格式是yyyy-mm-dd hh:mi:ss:mmm,很多时候我们可能会需要获取日期中的某个组成部分,因此SQL Server提供了一个daten ...

  2. HTML+CSS学习笔记整理二

    盒子模型CSS(重点) 边框border     边框通常使用连写border:1px(边框大小) solid(实线或其他)  red(颜色) border-collapse:collapse (合并 ...

  3. mysql 实现row_number功能

    需求: 解答:由于mysql 中没有类似oracle中的 row_number功能,要实现row_number 可以使用如下功能: Select pkid,(@row_number:=@row_num ...

  4. EntityFrameworkCore Db First 生成Model时出错 PowerShell 版本过低

    一般Windows7默认安装的是PowerShell 2.0 使用Vs2017开发.Net Core时.使用 EntityFrameworkCore Db First自动生成实体时需要用到下面命令: ...

  5. git远程写协作同步

    1:创建一个要提交的文件2 git init 初始化 3 git remote add origin https://github.com/maohongli/cang.git 建立远程连接4 git ...

  6. javascript实现上传图片并展示

    我们也都知道上传图片的样子是这样的(选择前)是这样的(选择后). 先在HTML设置图片上传 <form action="" method=""> & ...

  7. springMVC对RESTful的支持

    1:后台controller方法编写 @RequestMapping("/itemsLook/{id}") public ItemsCustom itemsLook(@PathVa ...

  8. Qt TCP通信

    工程文件 QT += network 服务端 #ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include <QTcpS ...

  9. 配置WDA程序到NWBC

    NWBC是通过角色来做的权限管理,包括菜单项. 如果用户没有分配对应的,登陆后看到的东西很少,或者空白. 这里需要先将BC的个性化参数全部配齐,方便使用.BC最左上角,点击,设置,个性化设置. 如下几 ...

  10. 华为企业级AS111-S,比较垃圾的地方

    今天换了一个华为企业级AS111-S 路由器,比较垃圾的地方: 1. 网页管理界面是https,却用一个无效的证书,chrome直接不能访问,IE可以访问,但第一次登陆改密码的时候就出错了. 然后怎么 ...