I need to be able to return an (X, Y) position from Java to Lua and I can’t figure out how to do it. With the C API you would just push the values onto the stack and then return the number of return values, but that doesn’t seem to be how LuaJava does it. Any suggestions?
Share
The problem may be that the first parameter is always the JavaFunction object itself. Let’s say you want a function
addmultwhich takes two numbers, and returns their sum and product. The numeric parameters have to be retrieved as indexes 2 and 3, as follows:Now, you should get a similar result in your code: