cocos2dx-lua lua-binding只綁定函數,不綁定類

lua調用c++方法時,如何不綁定c++類只綁定函數(調用c++的全局函數,而不是類的成員函數)。我這裏把全局函數寫在了AppDelegate.h中。 ----------1.添加全局函數 AppDelegate.h中在類外添加代碼: static int lua_cocos2dx_testFun(lua_State* L){    printf("這個是測試函數");    return 0;}
相關文章
相關標籤/搜索