Game Development Reference
In-Depth Information
The AppDelegate class
This class marks the first time your C++ app will talk to the underlying OS. It attempts to
map the main events mobile devices we want to dispatch and listen to. From here on, all
your application will be written in C++ (unless you need something else for a specific tar-
get) and from this point on, you can add conditional code for different targets.
In AppDelegate , you should set up the Director object (it is the Cocos2d-x all
powerful singleton manager object), to run your application just the way you want. You
can:
• Get rid of the application status information
• Change the frame rate of your application
• Tell Director where your high definition images are, and where your standard
definition images are, as well as which to use
• You can change the overall scale of your application, so it will best fit different
screens
• The AppDelegate class is also the best place to start any preloading process
• And most importantly, it is here you tell the Director object what Scene to be-
gin your application with
Here too, you will handle what happens to your application if the OS decides to kill it, push
it aside, or hang it upside down to dry. All you need to do is place your logic inside the cor-
rect event handler: applicationDidEnterBackground or applica-
tionWillEnterForeground .
Search WWH ::




Custom Search