Quick 2.23 their definition of C + + code LUA with a summary of some of the details

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.