![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Lua
灰色V
这个作者很懒,什么都没留下…
展开
-
lua常用函数
NO1.求一个字符串是否是纯数字。 --[[ NO1 @biref: 判断输入字符串是否为纯数字 @parames: str需要检测的字符串 @return: true 纯数字 ]]-- function checkNumber(str) local ret = true; local ret1,ret2 = string.find(str,"%a"); if re原创 2014-03-08 18:27:48 · 606 阅读 · 0 评论 -
lua 和xml交互
lua官方代码。 稍做修改 /** LuaXML License LuaXml is licensed under the terms of the MIT license reproduced below, the same as Lua itself. This means that LuaXml is free software and can be used for bo原创 2014-03-28 21:45:41 · 1758 阅读 · 0 评论 -
将lua中字符串转换成table,富文本
char* str = ((char*) tolua_tostring(tolua_S,1,0)); { lua_newtable(tolua_S); if (str == NULL) return 1; int n = 0; char ch = 0; char* ptr = str; while (true) { ch =原创 2014-03-29 00:29:41 · 5507 阅读 · 0 评论 -
quickCocos2dx 中添加自定义类,导出lua
1.在userpath\quick-cocos2d-x\lib\cocos2d-x\external\extra目录下,建立自定义导出类目录。 (我的目录为class) 2.在新建目录中添加自定义导出类,*.h文件和*.cpp文件。 #myMathEx.h文件 #ifndef _GAME_MYMATHEX_H_ #define _GAME_MYMATHEX_H_ class原创 2014-03-20 11:21:06 · 1281 阅读 · 0 评论 -
lua 类 面向对象的用法
--[[ 实现类的用法 ]]-- local _class={} function class(super) local class_type={} class_type.ctor=false class_type.super=super class_type.new=function(...) local obj={}原创 2014-03-26 10:06:49 · 745 阅读 · 0 评论