Ejemplo n.º 1
0
  public static void main(String[] main_args) throws LuaException, ClassNotFoundException {
    LuaState L = LuaStateFactory.newLuaState();
    L.openBase();

    L.LdoString(str);

    LuaObject func = L.getLuaObject("imprime");
    Object[] teste = func.call(new Object[] {"TESTANDO"}, 2);
    System.out.println(teste[0]);
    System.out.println(teste[1]);

    System.out.println("PROXY TEST :");
    Printable p = new ObjPrint();
    p.print("TESTE 1");

    LuaObject o = L.getLuaObject("luaPrint");
    p = (Printable) o.createProxy("org.keplerproject.luajava.test.Printable");
    p.print("Teste 2");

    L.close();
  }
Ejemplo n.º 2
0
 @Override
 public void onDestroy() {
   luastate.close();
   root.Ondestroy();
   System.gc();
 }