随笔分类 -  Lua

Lua中对于UTF-8字符串的处理
摘要:参考项目:https://github.com/Pogs/lua-utf8-simpleUTF-8字符串工具类Lua代码:utf8_simple.lua-- ABNF from RFC 3629---- UTF8-octets = *( UTF8-char )-- UTF8-char = UTF8-... 阅读全文

posted @ 2014-09-29 00:01 linchaolong 阅读(9880) 评论(0) 推荐(0)

Lua中面向对象编程的理解
摘要:模块模块是一个独立的空间,一个独立的环境,访问模块成员需要先require,并使用“模块名.成员名称”的格式访问。注意:模块是一个table。类在lua中所有对象都是一个table,类也是一个table,但类应该是一个只读的table,类的定义是通过创建一个模块实现的。lua代码:module("S... 阅读全文

posted @ 2014-09-08 14:36 linchaolong 阅读(6099) 评论(0) 推荐(0)

Cocos2dx-lua实现单例设计模式
摘要:定义一个单例类新建一个lua文件,命名为MyDirector.lua,代码如下:module("MyDirector",package.seeall)-- 成员变量local instance = nilprint("load MyDirector")-- 静态方法(不需要传self)functio... 阅读全文

posted @ 2014-09-05 11:57 linchaolong 阅读(1402) 评论(0) 推荐(0)

C++与Lua通信
摘要:参考文章地址:1.Lua与C++通信原理说明:http://blog.csdn.net/musicvs/article/details/84407072.Lua中的堆栈:http://blog.csdn.net/musicvs/article/details/84450273.Lua与C++通信De... 阅读全文

posted @ 2014-07-10 15:54 linchaolong 阅读(458) 评论(0) 推荐(0)

Lua中的常用函数
摘要:原文地址:http://www.cnblogs.com/actionkong/p/3636104.html常用函数 1、assert (v [, message]) 功能:相当于C的断言,当表达式v为nil或false将触发错误, message:发生错误时返回的信息,默认为"assertio... 阅读全文

posted @ 2014-07-10 14:41 linchaolong 阅读(977) 评论(0) 推荐(0)

导航