前端之家收集整理的这篇文章主要介绍了
cocos2dx luajavaBridge,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
LuaJavaBridge.java
public class LuaJavaBridge
{
// 开始录音
public static int sendLuaToJaveAudioRecordStart(final int type,final int num){
System.out.printf("%n","sendLuaToJaveAudioRecordStart **********************************");
AudioRecording.getInstance().startRecord();
return 1;
}
}
local args = { 2,3}。
local sigs = "(II)I"
local luaj = require "cocos.cocos2d.luaj"
local className = "com/cocos2dx/sample/LuaJavaBridge"
local ok,ret = luaj.callStaticMethod(className,"sendLuaToJaveAudioRecordStart",args,sigs)
if not ok then
print("luaj error:",ret)
else
print("The ret is:",ret)
end