public abstract class JavaFunction extends 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).| Modifier and Type | Field and Description |
|---|---|
protected LuaState |
L
This is the state in which this function will exist.
|
| Constructor and Description |
|---|
JavaFunction(LuaState L)
Constructor that receives a LuaState.
|
| Modifier and Type | Method and Description |
|---|---|
abstract int |
execute()
This method is called from Lua.
|
LuaObject |
getParam(int idx)
Returns a parameter received from Lua.
|
void |
register(String name)
Register a JavaFunction with a given name.
|
protected LuaState L
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.LuaExceptionpublic LuaObject getParam(int idx)
this).idx - Index of the parameter.LuaObjectpublic void register(String name) throws LuaException
name - name of the function.LuaException