in cocos2d-2.1beta3-x-2.1.0/samples/HelloLua
1.
1.1 i compiled lua files by using luac (luac - o hello.lua hello.lua;luac -o hello2.lua hello2.lua)
1.2 i changed AppDelegate.cpp to pEngine ->executeScriptFile("hello.lua")
in android platform
1.3 then build and run the android project. But it can’t load the lua file and show me black screen….
【question 1】Can’t cocos2d-x(android) load compiled lua in assets/ ?? in cocos2d-x, it run fine…
2.
2.1 i copy the hello.lua hello2.lua to /mnt/sdcard/
2.2 i changed AppDelegate.cpp to
pEngine->addSearchPath("/mnt/sdcard"); pEngine->executeString("package.path='?.lua;./?.lua;/mnt/sdcard/?.lua;'..package.path"); pEngine->executeScriptFile("/mnt/sdcard/hello.lua")
in android platform
2.3 then build and run the android project. it can run! but it show Notification “Get data from file(assets/hello2.lua) failed![]("
2.4 then i edit hello.lua, changed that @require “hello2”@ to @require “/mnt/sdcard/hello2”@. compile and copy hello.lua to /mnt/sdcard. It runs fine without any Notifications)
【question 2】Do i have to require”absolute path" in the lua files that run at sdcard??
Thank you.