
Lua开发
magicpang
C->CPP && ->Agile
展开
-
Lua upvalue
Another word for an upvalue in Lua is an external local variable. When you write a new function in Lua, it can access any of the local variables that have the same scope as it. That function 'clos转载 2016-02-17 18:56:22 · 617 阅读 · 0 评论 -
自定义sublime的快捷键
我把mbp上面的ctrl改成了meta所以windows下面要稍微改写下,不然按键比较怪这个是用于windows上面的,[{ "keys": ["alt+l"], "command": "svn_log" },{ "keys": ["alt+d"], "command": "svn_diff" },{ "keys": ["ctrl+a"], "command": "move_t原创 2016-05-31 10:13:40 · 482 阅读 · 0 评论 -
记录有用的开源库
一些开源库记录下Lua 的https://github.com/kingluo/luajit.io Pure Lua IO framework, with C efficiency due to its simple but powerful design, and, of course, thanks to luajit, the perfect JIT engine.转载 2016-03-24 18:45:40 · 382 阅读 · 0 评论 -
2D OBB Intersection
http://www.flipcode.com/archives/2D_OBB_Intersection.shtml--------------------------------------------------------------------2D OBB IntersectionFor 2D graphics or movement of 3D objects on a 2D转载 2016-04-14 17:36:30 · 744 阅读 · 0 评论 -
lua中尽量使用local
结论: lua 5.1.5 windows环境下 使用local变量能够稍微提高效率但是如果有了间接引用,比如 上面代码里面 local g = {} 定义成 local a = {}, a.g = {}增加了简介引用之后,效率就会发生变化了实际使用中不是很好控制比如通常一个lua文件通常写成 local a = {} --或者 local a = class(原创 2016-04-26 10:58:05 · 13261 阅读 · 0 评论 -
Cocos2.2.6创建项目cd tools/project-creator/
http://blog.youkuaiyun.com/a542214712/article/details/20638477cd tools/project-creator/./create_project.py ./create_project.py -project hicoco -package net.ataworld.game -language cpp转载 2016-04-12 23:22:13 · 475 阅读 · 0 评论 -
Texture packer命令行加密
@echo offtexturepacker fishjoy_kind/*.png --data FishJoyKind.plist --sheet FishJoyKind.pvr.ccz --format cocos2d --texture-format pvr2ccz --content-protection ADEFB88CA0D7DE87EE82A3CD9B3FECDF --opt RGB原创 2016-04-06 15:39:06 · 981 阅读 · 0 评论 -
C++返回table给lua
//定义函数(返回table)int func_return_table(lua_State *L){ lua_newtable(L);//创建一个表格,放在栈顶 lua_pushstring(L, "mydata");//压入key lua_pushnumber(L,66);//压入value lua_settable(L,-3);//弹出key,value,并设置到table里面转载 2016-02-26 10:47:33 · 2451 阅读 · 0 评论 -
阅读lmathlib.c
1. 重要的结构 luaL_Regtypedef struct luaL_Reg { const char *name; lua_CFunction func;} luaL_Reg;typedef int (*lua_CFunction) (lua_State *L);可以用该结构做参数简单的来创建tableluaL_newlib(L, mathlib);这样在栈顶创原创 2016-02-17 19:30:01 · 776 阅读 · 0 评论