Their definition of C + + code LUA and some of the summarized details
Reference: Click to open link
1. Define YourselfXXX. cpp.XXX. h
2.d:\quick\quick-cocos2d-x-2.2.3-rc\lib\cocos2d-x\external\extra\luabinding
CreateXXX_luabinding.tolua
$ #include "XXX.h"
Class XXX
{
static int getfiledata ();//write according to your own details
};
Create Build_XXX_luabinding.bat
@echo off
Set Dir=%~dp0
Set output_dir=%dir%
Set make_luabinding= "%quick_cocos2dx_root%\bin\compile_luabinding.bat"
pushd
CD "%dir%"
Call%make_luabinding%-E xxx-d%output_dir%XXX_luabinding.tolua
Echo.
Echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Echo.
REM Call%make_luabinding%-D%output_dir% Cocos2dx_extra_ios_iap_luabinding.tolua
popd
Change BUILD.bat
Add in the following
Echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Echo.
Call%make_luabinding%-D%output_dir%XXX_luabinding.tolua
3. Executive BUILD.bat
In the emulator project, add the appropriateXXX. cppXXX. h and the generatedXXX_luabinding.cpp andXXX_luabinding.h
4. In D:\quick\quick-cocos2d-x-2.2.3-rc\lib\cocos2d-x\scripting\lua\cocos2dx_support
In CCLuaStack.cpp
Add 67 rows
#include "Myhelperfunc_luabinding.h"
Join
BOOL Ccluastack::init (void) in 137 rows added
Luaopen_xxx_luabinding (m_state);
Edit the emulator to find the Player.exe and associated resources in the generated replacement win folder
In implementing their LUA code, the build succeeds.
Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.
Quick 2.23 their definition of C + + code LUA with a summary of some of the details