Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
d890c178
"tests/vscode:/vscode.git/clone" did not exist on "4a6440e93bdcd8bc4e964d1d2cbcd54490226852"
Unverified
Commit
d890c178
authored
Jan 27, 2019
by
Vinicius Jarina
Committed by
GitHub
Jan 27, 2019
Browse files
Update index.md
parent
471f219f
Changes
1
Show whitespace changes
Inline
Side-by-side
index.md
View file @
d890c178
NLua
========
[

]()
[

]()
NLua is a fork project of LuaInterface (from Fábio Mascarenhas/Craig Presti).
NLua
=======
[

]()
Example: using NLua from command line.
NLua allows the usage of Lua from C#, on Windows, Linux, Mac, iOS , Android, Windows Phone 7 and 8.
Unity3D support branch:
[
unity3d
](
https://github.com/Mervill/Unity3D-NLua
)
by
[
Riley G
](
https://github.com/Mervill/Unity3D-NLua
)
.
[
1
]:
https://www.dropbox.com/s/w99igtc12uocq4k/NLua.OSX.zip
[
2
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for OSX)
[
3
]:
https://www.dropbox.com/s/s3xte19719446lx/NLua.iOS.zip
| NuGet | NuGet (Pre-Release) |
[
4
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for iOS)
| ------|------|
|
[

](https://www.nuget.org/packages/NLua)|
[

](https://www.nuget.org/packages/NLua)|
| | Status |
| :------ | :------: |
|
**Linux**
|
[

](https://travis-ci.org/NLua/NLua) |
|
**AppVeyor**
|
[

](https://ci.appveyor.com/project/viniciusjarina/NLua)|
|
**Mac (Azure Pipelines)**
|
[

](https://dev.azure.com/NLua/NLua/_build/latest?definitionId=2&branchName=master) |
|
**Windows (Azure Pipelines)**
|
[

](https://dev.azure.com/NLua/NLua/_build/latest?definitionId=4&branchName=master) |
[
5
]:
https://www.dropbox.com/s/mjet2sh67e7y6xo/NLua.Android.zip
[
6
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for Android)
[
7
]:
https://www.dropbox.com/s/jkr1pnwvqw6w0r8/NLua.Win32.zip
Bridge between Lua world and the .NET (compatible with Xamarin.iOS/Mac/Android/.NET/.NET Core)
[
8
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for Win32)
[
9
]:
https://www.dropbox.com/s/xraxkgi2kuwbu4a/NLua.Win64.zip
Building
[
10
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for Win64)
---------
[
11
]:
https://www.dropbox.com/s/do8m3929mf0pwff/NLua.NoPInvoke.zip
msbuild
[
12
]:
http://nvlabs.github.com/cub/download-icon.png
(Download Pure C# - No P/Invoke)
[
13
]:
https://www.dropbox.com/s/c08wphdmk5o7tdx/NLua.WP7.zip
[
14
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for Windows Phone 7)
[
15
]:
https://www.dropbox.com/s/2pva1tyxpnn7feb/NLua.WPSL8.zip
=============================
[
16
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for Windows Phone Silverlight 8 (ARM+x86)
)
[
17
]:
https://www.dropbox.com/s/nonijkic8216f7l/NLua.WinRT.zip
NLua allows the usage of Lua from C#, on Windows, Linux, Mac, iOS , Android.
[
18
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for Windows Phone 8 (RT)
(ARM+x86)
)
[
19
]:
https://dl.dropboxusercontent.com/u/17523659/NLua.Unity3D.zip
[

]()
[
20
]:
http://nvlabs.github.com/cub/download-icon.png
(Download for Unity3D)
| | Build Status | Download |
NLua is a fork project of LuaInterface (from Fábio Mascarenhas/Craig Presti).
| :------ | ------: | :------: |
|
**Linux**
|
[

](https://travis-ci.org/NLua/NLua) |
|
**OSX**
|
[

](http://codefoco.zapto.org:8085/job/NLua_OSX/) |
[
![dwn_osx
][
2
]
][1] |
|
**iOS**
|
[

](http://codefoco.zapto.org:8085/view/X/job/NLua_iOS/) |
[
![dwn_ios
][
4
]
][3] |
|
**Android**
|
[

](http://codefoco.zapto.org:8085/view/X/job/NLua_Android/) |
[
![dwn_android
][
6
]
][5] |
|
**Win32**
|
[

](http://codefoco.zapto.org:8085/view/X/job/NLua_Windows/) |
[
![dwn_w32
][
8
]
][7] |
|
**Win64**
|
[

](http://codefoco.zapto.org:8085/view/X/job/NLua_Win64/) |
[
![dwn_w64
][
10
]
][9] |
|
**.NET Pure C#**
|
[

](http://codefoco.zapto.org:8085/view/X/job/NLua_WinSafe/) |
[
![dwn_winsafe
][
12
]
][11] |
|
**WP8 (Silverlight)**
|
[

](http://codefoco.zapto.org:8085/view/X/job/NLua_WinSafe/) |
[
![dwn_wpsl8
][
16
]
][15] |
|
**WP8 (WinRT)**
|
[

](http://codefoco.zapto.org:8085/view/X/job/NLua_WP8/) |
[
![dwn_wp8
][
18
]
][17] |
|
**Windows Phone 7**
| |
[
![dwn_wp7
][
14
]
][13] |
|
**Unity3D**
| |
[
![dwn_unity3d
][
20
]
][19] |
Example:
Example:
You can use/instantiate any .NET class without any previous registration or annotation.
You can use/instantiate any .NET class without any previous registration or annotation.
...
@@ -117,7 +91,7 @@ Retrieving global values:
...
@@ -117,7 +91,7 @@ Retrieving global values:
```
csharp
```
csharp
state
.
DoString
(
"y = 10 + x*(5 + 2)"
);
state
.
DoString
(
"y = 10 + x*(5 + 2)"
);
var
y
=
state
[
"y"
]
as
double
;
--
Retrieve
the
value
of
y
var
y
=
state
[
"y"
]
as
double
;
//
Retrieve the value of y
```
```
Retrieving Lua functions:
Retrieving Lua functions:
...
@@ -155,7 +129,7 @@ To do this just use the method `LoadCLRPackage` and use the `import` function in
...
@@ -155,7 +129,7 @@ To do this just use the method `LoadCLRPackage` and use the `import` function in
```
csharp
```
csharp
state
.
LoadCLRPackage
();
state
.
LoadCLRPackage
();
state
.
DoString
(
@" import ('MyAssembly
.exe
', 'MyNamespace')
state
.
DoString
(
@" import ('MyAssembly', 'MyNamespace')
import ('System.Web') "
);
import ('System.Web') "
);
// import will load any .NET assembly and they will be available inside the Lua context.
// import will load any .NET assembly and they will be available inside the Lua context.
```
```
...
@@ -205,7 +179,7 @@ If you are using Xamarin.iOS you need to [`Preserve`](http://developer.xamarin.c
...
@@ -205,7 +179,7 @@ If you are using Xamarin.iOS you need to [`Preserve`](http://developer.xamarin.c
##Sandboxing##
##Sandboxing##
There is many ways to sandbox scripts inside your application. I strongly recomend you to use plain Lua to do your sandbox.
There is many ways to sandbox scripts inside your application. I strongly recom
m
end you to use plain Lua to do your sandbox.
You can re-write the
`import`
function before load the user script and if the user try to import a .NET assembly nothing will happen.
You can re-write the
`import`
function before load the user script and if the user try to import a .NET assembly nothing will happen.
```
csharp
```
csharp
...
@@ -216,7 +190,17 @@ You can re-write the `import` function before load the user script and if the us
...
@@ -216,7 +190,17 @@ You can re-write the `import` function before load the user script and if the us
[
Lua-Sandbox user-list
](
http://lua-users.org/wiki/SandBoxes
)
[
Lua-Sandbox user-list
](
http://lua-users.org/wiki/SandBoxes
)
Copyright (c) 2014 Vinicius Jarina (viniciusjarina@gmail.com)
Copyright (c) 2019 Vinicius Jarina (viniciusjarina@gmail.com)
NLua 1.4.x
----------
NLua huge cleanup and refactor after a few years.
*
Moved to .NET C# style.
*
Using KeraLua as nuget dependencie.
*
Droped support for KopiLua/Silverlight/Windows Phone
NLua 1.3.2
NLua 1.3.2
----------
----------
...
@@ -360,7 +344,7 @@ your own build/binaries for Lua5.1.1 or use the version distributed here.
...
@@ -360,7 +344,7 @@ your own build/binaries for Lua5.1.1 or use the version distributed here.
(Lots of thanks to Steffen Itterheim for this work!)
(Lots of thanks to Steffen Itterheim for this work!)
LuaInterface.Lua no longer has OpenLibs etc... The base mechanism for
LuaInterface.Lua no longer has OpenLibs etc... The base mechanism for
library loading for Lua has changed, and we haven't yet broken ap
p
art
library loading for Lua has changed, and we haven't yet broken apart
the library loading for LuaInterface. Instead, all standard Lua libraries
the library loading for LuaInterface. Instead, all standard Lua libraries
are automatically loaded at start up.
are automatically loaded at start up.
...
@@ -464,3 +448,6 @@ instead of
...
@@ -464,3 +448,6 @@ instead of
Make sure the assemblies of the types you are passing have been loaded, or the call
Make sure the assemblies of the types you are passing have been loaded, or the call
will fail. The test cases in src/TestLuaInterface/TestLua.cs have examples of the new
will fail. The test cases in src/TestLuaInterface/TestLua.cs have examples of the new
functions.
functions.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment