org.keplerproject.luajava
public abstract class JavaFunction extends java.lang.Object
execute
method. This execute
method is the method that will be called when you call the function from Lua.
To register the JavaFunction in Lua use the method register(String name)
.Constructor and Description |
---|
JavaFunction(LuaState L)
Constructor that receives a LuaState.
|
public JavaFunction(LuaState L)
L
- LuaState object associated with this JavaFunction objectpublic abstract int execute() throws LuaException
getParam
. A reference to the JavaFunctionWrapper itself is
always the first parameter received. Values passed back as results
of the function must be pushed onto the stack.LuaException
public LuaObject getParam(int idx)
this
).idx
- Index of the parameter.LuaObject
public void register(java.lang.String name) throws LuaException
name
- name of the function.LuaException