在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):kevinresol/hxvm-lua开源软件地址(OpenSource Url):https://github.com/kevinresol/hxvm-lua开源编程语言(OpenSource Language):Haxe 100.0%开源软件介绍(OpenSource Introduction):Haxe Lua BindingsEmbed the Lua scripting engine into your Haxe application Supported targets
Example Usage// create an instance
var lua = new vm.lua.Lua();
// set global variables
lua.setGlobalVar('square', function(v) return v * v);
lua.setGlobalVar('foo', 2);
// run a script
lua.run('return square(foo)'); // gives you 4
// supply an object as second paramter to run() to set global vars
lua.run('return bar', {bar: 2}); // gives you 2
// run function
lua.run('function add(a, b) \n return a + b \n end'); // first we create a lua function
lua.call('add', [1, 2]); // gives you 3
// destroy when done with the instance
lua.destroy(); InstallTarget C++When targeting C++ we compile the Lua runtime from its C source code.
Target JSWhen targeting JS we utilize Fengari, which is the Lua VM written in pure JavaScript. You can choose to either build a standalone js file for Fengari or For browser without bundlers
For Node.js or browser js with bundlers
TODO
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论