Reputation: 119
I've been trying to make the HelloLua example to work in Android. It works if the hello.lua is not in compiled form using luac. But if I compile the hello.lua and upload it in my Android phone, it just gives me a black screen. Can anyone help me out in this?
This is the code in the AppDelegate::applicationDidFinishLaunching()
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
CCString* pstrFileContent = CCString::createWithContentsOfFile("hello.lua");
if (pstrFileContent)
{
pEngine->executeString(pstrFileContent->getCString());
}
#else
std::string path = CCFileUtils::sharedFileUtils()->fullPathForFilename("hello.lua");
pEngine->addSearchPath(path.substr(0, path.find_last_of("/")).c_str());
pEngine->executeScriptFile(path_c_str());
#endif
Seems that compiled lua works when I'm running in Windows but not in Android.
Upvotes: 1
Views: 637