AKever

导航

文章分类 -  Lua_Base

1 2 下一页

Yes, it is just Lua!
使用 tolua++ 将C++对象暴露给lua
摘要:使用 tolua++ 将C++对象暴露给luavs2012 + lua5.1.4 + tolua++----------------------------------------------------------------------------------------------1. 收集资... 阅读全文

posted @ 2015-06-24 14:56 AKever 阅读(567) 评论(0) 推荐(0)

Cocos2dx 3.x 暴露Cpp接口ToLua
摘要:Cocos2dx 3.x 暴露Cpp接口ToLua新建项目:http://www.cnblogs.com/TS-qrt/articles/cocos_cre.htmlcocos new LuaToCpp -p com.luatocpp.main -l cpp -d D:\cocos\cocos2d-... 阅读全文

posted @ 2015-06-24 11:14 AKever 阅读(300) 评论(0) 推荐(0)

把lua文本文件“编译”成二进制的文本
摘要:把lua文本文件“编译”成二进制的文本luac -o helloworld helloworld.lua这一行代码会编译helloworld.lua脚本并在helloworld文件中生成二进制数据。luac.exe执行文件的生成:http://www.cnblogs.com/TS-qrt/artic... 阅读全文

posted @ 2015-06-18 18:49 AKever 阅读(1085) 评论(0) 推荐(0)

编译lualib.lib(cpp与lua交互第一步)
摘要:编译lualib.lib(cpp与lua交互第一步)VS2012, lua5.3.0====================================================1. 下载lua源码 http://www.lua.org/download.html 解压后得到:docs... 阅读全文

posted @ 2015-05-18 15:24 AKever 阅读(1546) 评论(0) 推荐(0)

Lua io库
摘要:1、io表调用方式:使用io表,io.open将返回指定文件的描述,并且所有的操作将围绕这个文件描述 io表同样提供三种预定义的文件描述io.stdin,io.stdout,io.stderr 2、文件句柄直接调用方式,即使用file:XXX()函数方式进行操作,其中file为io.open()... 阅读全文

posted @ 2014-08-06 15:09 AKever 阅读(575) 评论(0) 推荐(0)

Lua 操作系统函数-- 时间
摘要:Lua 操作系统函数-- 时间时间:lua 程序设计2 page193time和date两个函数在Lua中实现所有的时钟查询功能。函数time在没有参数时返回当前时钟的数值。(在许多系统中该数值是当前距离某个特定时间的秒数。)当为函数调用附加一个特殊的时间表时,该函数就是返回距该表描述的时间的数值。... 阅读全文

posted @ 2014-08-06 14:51 AKever 阅读(471) 评论(0) 推荐(0)

Lua string库函数
摘要:Lua的string库函数列表转自:http://wgxsoft.blog.163.com/blog/static/173819171201352035531623/基本函数函数描述示例结果len计算字符串长度string.len(“abcd”)4rep返回字符串s的n个拷贝string.rep(“... 阅读全文

posted @ 2014-08-06 14:27 AKever 阅读(320) 评论(0) 推荐(0)

LUA loadstring 应用与优化
摘要:LUA loadstring 应用与优化LUAloadstring类似加载,从给定的字符串得到块。要加载和运行一个给定的字符串一般用法:assert(loadstring(script))()and then:f = loadstring("a = 1") 相当于:f = loadstring("... 阅读全文

posted @ 2014-08-06 11:59 AKever 阅读(2258) 评论(0) 推荐(0)

Lua 性能优化篇(全局与非全局)
摘要:转自:http://www.superyyl.com/?p=104Lua 性能优化篇(全局与非全局)在代码运行前,Lua会把源码预编译成一种中间码,类似于Java的虚拟机。这种格式然后会通过C的解释器进行解释,整个过程其实就是通过一个while循环,里面有很多的switch...case语句,一个c... 阅读全文

posted @ 2014-08-06 11:18 AKever 阅读(6745) 评论(1) 推荐(2)

Lua 弱引用table
摘要:转自:http://www.cnblogs.com/stephen-liu74/archive/2012/07/09/2423565.html同时:Lua程序设计(2) page 153Lua 弱引用tableLua采用了基于垃圾收集的内存管理机制,因此对于程序员来说,在很多时候内存问题都将不再困扰... 阅读全文

posted @ 2014-08-05 15:37 AKever 阅读(558) 评论(0) 推荐(0)

Lua的多重继承
摘要:Lua的多重继继承code继承的实现local function search (k, plist) for kk, vv in pairs(plist) do local v = vv[k] -- try `i'-th superclass if v ... 阅读全文

posted @ 2014-08-05 15:11 AKever 阅读(454) 评论(0) 推荐(0)

lua 协同程序 coroutine
摘要:Lua 协同程序 coroutineco = coroutine.create(function() print("hi") coroutine.yield() --挂起(suspended) end)coroutine.status(co)coroutine.... 阅读全文

posted @ 2014-08-04 10:44 AKever 阅读(1523) 评论(0) 推荐(0)

Lua 链表
摘要:lua链表list = nilfor line in io.lines() do list = {next=list, value=line}end从标准输入中读取每行的内容,然后存储到一个链表中。链表的每个节点都是table,table有两个字段:value(每行内容)和next(指向下一个... 阅读全文

posted @ 2014-08-01 16:33 AKever 阅读(451) 评论(0) 推荐(0)

Lua 基础篇1
摘要:-----阶乘与数据的读取----------function fact(n) if n == 0 then return 1 else rturn n*fact(n-1) endendprint("enter a number: ")a = io.re... 阅读全文

posted @ 2014-08-01 14:21 AKever 阅读(328) 评论(0) 推荐(0)

quick-cocos2dx2.2.5 编译apk
摘要:quick-cocos2dx2.2.5 编译apk安装cygwin; 安装 ndk; 安装jdk; 安装eclipse配置环境变量ANDROID_NDK_ROOT = "D:\Cocos\android-ndk-r9b"QUICK_COCOS2DX_ROOT (quick已经自动添加)Path(4个... 阅读全文

posted @ 2014-07-22 13:29 AKever 阅读(311) 评论(0) 推荐(0)

quick-cocos2dx 2.2.5 vs2012 babelua 插件
摘要:quick-cocos2dx 2.2.5 vs2012 babelua 插件http://blog.csdn.net/babestudio/article/details/30093699插件地址:... 阅读全文

posted @ 2014-07-17 15:42 AKever 阅读(180) 评论(0) 推荐(0)

quick-cocos2dx(Lua) 2.2.5 (2.2.x的最后一个版本)
摘要:quick-cocos2dx(Lua) 2.2.5 (2.2.x的最后一个版本)下载->解压->运行根目录setup_win.bat文件 ok创建项目:cmd-> cdD:\Cocos\quick-cocos2d-x-2.2.5\bin (create_project.bat)create_proj... 阅读全文

posted @ 2014-07-17 15:18 AKever 阅读(385) 评论(0) 推荐(0)

Lua table中的排序sort
摘要:lua中的table排序a = { {"hello",3}, {"world",2},};local sortFunc = function(a,b) return a[1] < b[1];endtable.sort(a,sortFunc );a中可以排序的index是从1开始计算的。很棒!转... 阅读全文

posted @ 2014-06-26 10:46 AKever 阅读(277) 评论(0) 推荐(0)

Lua cocos2dx-HelloLua
摘要:cocos2dx-HelloLua解析:http://blog.sina.com.cn/s/blog_7d1531ed01019h50.html 阅读全文

posted @ 2014-06-17 00:27 AKever 阅读(119) 评论(0) 推荐(0)

Lua Array Matrice List set bag
摘要:1.Lua ArrayFor instance, after the following code,any attempt to access a field outside the range 1–1000 will return nil, instead ofzeroa = {} -- new a... 阅读全文

posted @ 2014-06-11 22:34 AKever 阅读(701) 评论(0) 推荐(0)

1 2 下一页