The quick-cocos2d-x uses luajit to compile Lua scripts

Source: Internet
Author: User

Still use the test project generated last time. I put it in the bin directory.

Create the file test. bat in the bin directory. The content is as follows:

@ Echo offset dir = % ~ Dp0 % dir % Win32 \ php.exe % dir % \ Lib \ compile_scripts.php-zip-x main test/scripts/test/RES/test

Let's talk about the usage of complie_scripts.php:

Usage: compile_scripts [Options] dirname output_filenameoptions:-zip package to zip-suffix package file extension name-P prefix package name-x exclude packages, eg:-x framework. server, framework. tests-Q quietexamples: * packageing scripts /*. lua to RES/game.zip compile_scripts-zip scripts/RES/Game

Note: You need to add the quick-cocos2d-x \ bin \ Win32 Directory to the system path environment variables, in addition to the process may prompt the lack of msvcr110.dll file, you can solve it yourself.

After you run test. bat, the test.zip file is generated in the test/res.

To call the script, add the following code in the cclualoadchunksfromzip ("Res/framework_precompiled.zip") Statement in the mail. Lua file:

Cclualoadchunksfromzip ("Res/test.zip ")

Delete the original script. Keep main. Lua and test it to prove that the program can run.

In this way, the script does not need encryption and decryption.

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.