lua

以下是为您整理出来关于【lua】合集内容,如果觉得还不错,请帮忙转发推荐。

【lua】技术教程文章

Using an LPC-Link2 as an LPC4370 evaluation board

https://www.lpcware.com/content/faq/lpcxpresso/using-lpclink2-as-lpc4370-evalAs well as being a standalone debug probe, the LPC-Link2 can also be used as a simple LPC4370 evaluation board.The following notes may assist in such usage.Debug connectionMake sure that you have connected the JTAG/SWD cable from your debug probe to the target LPC-Link2‘s connector J2 (and not J7!).Thus if you are using ...

(原创) cocos2d-x 3.0+ lua 学习和工作(4) : 公共函数(8): 生成只读table【代码】

这个函数的作用是:生成只读table。--[[ -- 生成只读table -- @param table t 需要不允许修改的tableexample:local tb = {"星期一", "星期二", "星期日"} local days = readOnly( tb );days[2] = "星期三哪去了啊?" ;"[string \"Functions.lua\"]:466: 别修改我!我是只读的!" --]] function readOnly( t )local newT = tlocal mt = {__index = {}, -- 如果改成 newT = {}, __index = t, 会导致无法直接使用for循环遍历,...

Lua2.4 打印字节码 print.c【代码】

现在编译器相关的部分就剩下 luac.c 中的 do_dump 函数的分析了。这个函数里面主要有两种调用,存储字节码和打印字节码。先来看一下打印字节吧,要打印字节码,需要在编译器的命令行选项中有 "-l" 选项。static void do_dump(TFunc* tf) /* only for tf==main */ { if (dumping) DumpHeader(D); while (tf!=NULL) { TFunc* nf; if (listing) PrintFunction(tf); if (dumping) DumpFunction(tf,D); nf=tf->next; ...

lua解释执行脚本流程【代码】【图】

1 #include "lua.hpp" 2 3 #include <iostream>4usingnamespace std;5 6#pragma comment(lib, "lua5.1.lib")7 8struct lua_guard{9 lua_State *pL; 10 lua_guard(lua_State *s) :pL(s){} 11 ~lua_guard(){ lua_close(pL); } 12}; 1314int main(){ 15 lua_guard g(lua_open()); 16 luaL_openlibs(g.pL); 17int err; 18if ((err = luaL_dofile(g.pL, "mylua.lua") != 0)){ 19throw runtime_error("open lua file e...

Cocos2dx+lua合适还是Cocos2dx+js合适?

问题:开发cocos2dx手游Cocos2dx+lua合适还是Cocos2dx+js合适百牛信息技术bainiu.ltd整理发布于博客园回答:作者:廖宇雷链接:https://www.zhihu.com/question/21130385/answer/18485625来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。2014.02更新:请放心选择 Lua 吧。触控已经收购了 quick-cocos2d-x,2014年肯定会大力强化 cocos2d-x 的 Lua 支持。----我个人肯定是推荐 Lua 的,原因如下:1...

Nginx编译安装Lua模块【代码】

Nginx编译安装Lua模块一、安装Lua环境及相关库官网网址:https://github.com/openresty/lua-nginx-moduleLuaJIT `wget http://luajit.org/download/LuaJIT-2.0.2.tar.gzmake install PREFIX=/usr/local/LuaJITexport LUAJIT_LIB=/usr/local/LuaJIT/libexport LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.0`ngx_devel_kit和lua-nginx-module ``` cd /opt/downloadwget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.t...

Lua杂项【代码】

lua的全局变量全都保存在table里面,名字叫: _G设置不能访问不存在的全局变量,不能赋值不存在的全局变量setmetatable(_G, {__index = function(_, n)error("attempt to read undeclared variable" .. n, 2)end,__newindex = function(_, n)error("attempt to write undeclared variable " .. n, 2)end})在这种情况下该如何给不存在的全局变量赋值以下方法可行么?测试不通过,环境5.3.5function declare( name, initval )rawset(_...

Quick cocos2dx-Lua(V3.3R1)学习笔记(四)----文本渲染之用BM TTF创建文本【代码】【图】

上一篇我们显示了背景图和文字,这一篇我们详细介绍一下文本显示的方法 一,显示fnt格式字体首先我们下载BMF格式文件制作工具,Bitmap Font Generator下载地址:http://www.angelcode.com/products/bmfont/安装完毕,我们打开这个工具,看到如下的界面 左边就是单独字体 右边就是字体库(注意:如果要有符号输入,将第一项Latin+Latin Supplenment打钩)(你看你看,我不是所有括号都有自言自语的)我们来创建字体点击Options下面的...

Lua wait sleep

使用os.execute 执行涉及等待、超时的外部命令、程序。配合 >nul 不显示标准输出流信息。执行过程是阻塞(block)等待的。 os.execute"ping 1.1.1.1 /n 1 /w <time in milliseconds> >nul" ,如os.execute"ping 1.1.1.1 /n 1 /w 1000 >nul" 。os.execute"CHOICE /n /d:y /c:yn /t:1 >nul" 。为(Windows)系统安装GNU命令包(minGW?)。>sleep --helpUsage: sleep NUMBER[SUFFIX]... or: sleep OPTIONPause for NUMBER seconds....

cocos-lua基础学习(四)quick层封装后的目录结构

命名空间cc  cocos2d核心类ccb  cocosbuilder扩展ccs  cocostudio扩展 cocos2d目录结构bitExtend.lua  cocos2d.luacocos2dConstants.luafuntions.lua  提供一组常用函数,以及对 Lua 标准库的扩展json.lua  json的编码与解码luaj.lua  Lua与Java之间的交互接口luaoc.lua  Lua与Objective-c之间的交互接口Opengl.luaOpenglConstants.lua cocostudio目录结构CocoStudio.luaStudioConstants.luaDeprecatedCocoStudio...

LUA - 相关标签