MCPcopy Create free account
hub / github.com/axmolengine/axmol / applicationDidFinishLaunching

Method applicationDidFinishLaunching

templates/lua/Source/AppDelegate.cpp:53–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53bool AppDelegate::applicationDidFinishLaunching()
54{
55 // set default FPS
56 Director::getInstance()->setAnimationInterval(1.0 / 60.0f);
57
58 // register lua module
59 auto engine = LuaEngine::getInstance();
60 ScriptEngineManager::getInstance()->setScriptEngine(engine);
61 lua_State* L = engine->getLuaStack()->getLuaState();
62 lua_module_register(L);
63
64 LuaStack* stack = engine->getLuaStack();
65
66 // register custom function
67 // LuaStack* stack = engine->getLuaStack();
68 // register_custom_function(stack->getLuaState());
69
70 stack->addSearchPath("src");
71 FileUtils::getInstance()->addSearchPath("res");
72 if (engine->executeString("require 'main'"))
73 {
74 return false;
75 }
76
77 return true;
78}
79
80// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked.
81void AppDelegate::applicationDidEnterBackground()

Callers

nothing calls this directly

Calls 7

getInstanceFunction · 0.85
lua_module_registerFunction · 0.85
setScriptEngineMethod · 0.80
getLuaStateMethod · 0.80
setAnimationIntervalMethod · 0.45
addSearchPathMethod · 0.45
executeStringMethod · 0.45

Tested by

no test coverage detected