Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. // Setup Vector class
  2. LuaValue vectorClass = CoerceJavaToLua.coerce(Vector3Lua.class);
  3. globals.set("Vector3", vectorClass);
  4.  
  5. // Bind .new() to constructor function
  6. LuaTable t = new LuaTable();
  7. t.set("__add", new TwoArgFunction() {
  8.     public LuaValue call(LuaValue x, LuaValue y) {
  9.         System.out.println("TEST1: " + x);
  10.         System.out.println("TEST2: " + y);
  11.         return x;
  12.     }
  13. });
  14. t.set("__index", t);
  15. vectorClass.setmetatable(t);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement