Search code examples
kobold2d

didEnterBackground in Kobold2d


In Cocos2d I would implement - (void)applicationDidEnterBackground:(UIApplication *)application inside of the AppDelegate, but in Kobold2d (I haven't worked with it much) that is all handled by config.lua, which is great, but how do I handle these exit/enter/background state changes of the application?

Do I have to to override something, or is there some specific place? I'm not sure what the best practice is here and either I am having a lot of trouble finding a resource online.

Thanks!


Solution

  • You can simply add these methods to your project's AppDelegate class. AppDelegate derives from KKAppDelegate which implements the UIApplicationDelegate.

    Make sure to call [super method] for every method since KKAppDelegate implements basic behavior and relies on receiving some of the UIApplicationDelegate methods.