How to change c++ code to luacode

Well , I has some trouble on howe to change the exists ccode to lua mode。 Our game has released ,We used cocos2d-x engine to develop the project,and the engine version is 2.0.4。now ,we face a problem,the leader wants to change the game activity view without release a new game version,so ,I select lua to reach this target,but , I don’t want to change other c code,just change one part of the code。 I search a lot of online information to support my tatget,but ,allmost all tutorials tell visitors to create a new luaproject。Hope some developers can tell me how to do this? Sorry for my poor English!

you must export your c*+ code interface to lua, you can write yourself or use tolua*+. there is a example named hellolua in cocos2d-x, it’s a good way to start.

NosicLin F wrote:

you must export your c*+ code interface to lua, you can write yourself or use tolua**. there is a example named hellolua in cocos2d-x, it’s a good way to start.
But wouldn’t that mean I have to re-create the project so that it has Lua support? The HelloLua project only demonstrates how you can create a game using cocos2d-x with Lua. It doesn’t demonstrate how you can switch from C*+ to Lua and back to C++.

Well, your website can’t be visited. Lance Gray wrote:

NosicLin F wrote:
> you must export your c*+ code interface to lua, you can write yourself or use tolua**. there is a example named hellolua in cocos2d-x, it’s a good way to start.
>
But wouldn’t that mean I have to re-create the project so that it has Lua support? The HelloLua project only demonstrates how you can create a game using cocos2d-x with Lua. It doesn’t demonstrate how you can switch from C*+ to Lua and back to C++.