cocos:C++ 导出到lua, cocos2dx_extension.ini修改
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修改的更多相关文章
- cocos:C++ 导出到lua, genbindings.py修改
cocos:C++ 导出到lua, genbindings.py修改 1. 准备 把tools目录下的cocos2dx_extension.ini, genbindings.py, userconf. ...
- c++对象导出到lua
转自:http://www.cnblogs.com/ringofthec/archive/2010/10/26/luabindobj.html 虽然有tolua++, luabind等等, 不过自己手 ...
- hiredis异步接口封装并导出到Lua
hiredis异步接口封装并导出到Lua(金庆的专栏 2017.1)hiredis 不支持 Windows, Windows 下使用 wasppdotorg / hiredis-for-windows ...
- eclipse.ini 修改默认编码为 UTF-8
eclipse.ini 修改默认编码为 UTF-8 打开您的eclipse安装目录,找到eclipse.ini文件 打开eclipse.ini文件,在最下面加入一行代码:-Dfile.encoding ...
- cocos2d-x中CCEditbox导出到lua
自从工作后感觉时间较少(每天工作9-22,晚上就不想动了,早上想多睡点),工作中用的是 cocos2d-x.cocos2d-x是一款手机游戏引擎,虽然支持lua,但和love2d相比非纯lua游戏引 ...
- cocos studio UI 1.6.0.0 修改导出项目路径
因为cocos studio UI 1.6.0.0版本没有自动修改默认导出路径的功能,新建项目后默认导出的路径还是上一个项目的,每次导出都要重新设置路径很麻烦.于是考虑是否可以找到默认配置文件,终于还 ...
- cocos进阶教程(1)Lua调用自定义C++类和函数的最佳实践
第一层:纯C环境下,把C函数注册进Lua环境 a.lua 文件 )) a.c 文件 #include <lua.h> #include <lualib.h> #include ...
- php.ini修改php上传文件大小限制的方法详解
打开php.ini,首先找到file_uploads = on ;是否允许通过HTTP上传文件的开关.默认为ON即是开upload_tmp_dir ;文件上传至服务器上存储临时文件的地方,如果没指定就 ...
- 学习cocos code ide 的lua编程
装上了cocos code ide,配了路径之后,建立一个默认lua工程,发现无法调试,报错. 问了别人,在cocos2dconstants.lua的613行插入cc.AsyncTaskPool = ...
随机推荐
- spring boot中的日志入门
日志通常不会在需求阶段作为一个功能单独提出来,也不会在产品方案中看到它的细节.但是,这丝毫不影响它在任何一个系统中的重要地位. 报警系统与日志系统的关系 为了保证服务的高可用,发现问题一定要及时,定位 ...
- 基于贝叶斯网(Bayes Netword)图模型的应用实践初探
1. 贝叶斯网理论部分 笔者在另一篇文章中对贝叶斯网的理论部分进行了总结,在本文中,我们重点关注其在具体场景里的应用. 2. 从概率预测问题说起 0x1:条件概率预测模型之困 我们知道,朴素贝叶斯分类 ...
- 2019-11-29-WPF-高性能笔
原文:2019-11-29-WPF-高性能笔 title author date CreateTime categories WPF 高性能笔 lindexi 2019-11-29 10:20:51 ...
- c#对象深复制demo
public class Person : ICloneable { public string Name; object ICloneable.Clone() { return this.Clone ...
- PIE SDK栅格矢量化算法
1.算法功能简介 栅格数据矢量化较为复杂,如果由一幅扫描的数字化地图来建立矢量数据库,则需要经过数字图象处理,如边缘增强.细化.二值化.特征提取及模式识别才能获得矢量数据.人们通常将多色地图分色后逐个 ...
- 活动任务出现bug
之前做的一个活动任务发现一个bug,是以前和离职同事一起对逻辑的时候没有考虑到的,配置活动的时候应该要先查询下,如果这个产品线上在这段时间已经配置了并且上线了,则不能在做活动处理了,否则就和前面的活动 ...
- 简述Linux开机启动流程
计算机开机是一个神秘的过程.我们只是按了开机键,就看到屏幕上的进度条或者一行行的输出,直到我们到达登录界面.然而,计算机开机又是个异常脆弱的过程,我们满心期望的登录界面可能并不会出现,而是一个命令行或 ...
- PHP错误日志相关
https://cloud.tencent.com/developer/article/1167951 php错误日志总结 https://cloud.tencent.com/developer/ ...
- G++命令
gcc and g++分别是gnu的c & c++编译器. 从源代码到可执行文件的四步 gcc/g++在执行编译工作的时候,总共需要4步 1.预处理,生成.i的文件,用到预处理器cpp.这一步 ...
- FCC-学习笔记 DNA Pairing
FCC-学习笔记 DNA Pairing 1>最近在学习和练习FCC的题目.这个真的比较的好,推荐给大家. 2>中文版的地址:https://www.freecodecamp.cn/;英 ...