문제

Within my code, I need to push an int onto Lua's stack. I know of the lua_pushnumber for C, but what would be used in LuaJ? I can't find a function for it, given that LuaJ isn't clear as to what functions represent certain C functions.

도움이 되었습니까?

해결책

LuaJ abstracts things like stack management away. So if you're trying to call a Lua function, you don't have to push values onto the stack. Just get the Lua function as a LuaFunction variable and call it with the invoke method. To return multiple values from a Java function registered with Lua, you have to return a Varags object. You put your multiple values into that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top