lua
dongforever
享受生活,创造生活。
展开
-
lua字符串分割
function string_split(s,delim) local start = 1; local t = {}; while true do local pos = string.find (s, delim, start, true) if not pos then break end tab原创 2015-10-29 16:25:47 · 347 阅读 · 0 评论 -
lua的类
类是包含属性与方法的一个集合。是一个键值对的集合。 可以用lua中的表来模拟类。A = {} A.__index = A function A:new() local o = {} setmetatable(o,A) return o endfunction A:test() print("this is a class test") end--使用类A objA原创 2015-10-30 15:43:36 · 503 阅读 · 0 评论 -
使用quick-cocos2dx制作拼图游戏
使用quick-cocos制作拼图游戏原创 2015-12-28 14:32:38 · 2796 阅读 · 2 评论 -
quick-cocos2dx将C++导出lua
可以按照官网教程来做。个人总结,分为5步: 进行相关环境配置。 编写.h .cpp文件。 在引擎frameworks\cocos2d-x\tools\tolua目录下重写*.ini配置文件与genbindings.py脚本。 执行自定义的genbindings.py脚本,得到生成的lua_*_auto.cpp 和lua_*_auto.hpp文件。默认路径在frameworks\cocos2d-原创 2016-01-05 17:35:22 · 1322 阅读 · 0 评论 -
quick cocos 截屏并保存
调用cc.RenderTexture 即可。 --需要截的屏幕大小 local render_texture = cc.RenderTexture:create(640, 1136) --开始截屏 render_texture:begin() --截self.node_container包含的内容 self.node_container:visit()原创 2015-12-24 17:44:23 · 2619 阅读 · 0 评论