Exemplo n.º 1
0
 /// <summary>
 /// Creates a new LuaThread object with a new thread out of the context of the given Lua state.
 /// </summary>
 /// <param name="parent"></param>
 public LuaThread(Lua parent)
 {
     if (parent == null || parent.Handle == IntPtr.Zero)
     { // Error the parent is null
         throw new ArgumentNullException("parent");
     }
     this.lua = NativeLua.lua_newthread(parent.Handle);
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Lua lua = null;
            /*
            lua.Register("writeline", new LuaCallbackFunction(WriteLine));
            lua.ProtectedCall();

            lua.Tables.Global.Push("hello", "world");
            Console.WriteLine(lua.Tables.Global.Pop("hello"));
            Console.WriteLine(lua.Tables.Global.Pop("hello"));*/
            //try
            {
                lua = new Lua("main.lua");
                lua.LoadLibrary(typeof(Screen));
                lua.Execute();
            }
            /*catch (Exception err)
            {
                Console.WriteLine(err.Message);
            } */

            Console.ReadKey();
        }