Game Development Reference
In-Depth Information
Preparing Assets for PhoneGap
Similar to the iOS home screen app that was built in Chapter 12, icons and splash screens are needed for packaging
your apps. These assets will be referenced in the config.xml file that is needed for PhoneGap to properly build your
application.
These graphics are built similarly to how they were prepared for the Fakezee web app, and the icons can be
reused for this project. The main difference is in the splash images: in the PhoneGap app they need to be a bit bigger.
This is because you no longer need to compensate for the status bar, like you are forced to in a web app environment.
Another key difference is that the landscape images should actually be landscape in ratio, as opposed to rotated, like
is needed with web apps.
The icons and splash images for Android are prepared similarly, but will need their own set of properties to work
across devices. Using the same design files for iOS, these assets can be prepared accordingly to match the required
sizes. Using the configuration file for a reference, you will find the list of necessary assets and sizes. Let's get into this
configuration file now.
Preparing the PhoneGap Configuration File
The configuration file holds many configuration properties for your PhoneGap application. It holds version numbers,
asset locations, permissions, plug-ins, and more. For the purposes of this project, you don't need to configure much
more than the locations to the graphical assets and a few platform settings and preferences.
The configuration file for PhoneGap is written in XML, and must be included at the root of your application when
packaging for PhoneGap Build. The configuration file is used to apply settings and features to your application that
would otherwise be set within files or the IDEs used to build native apps.
Listing 13-3 shows the beginning of the config.xml file. You will be adding more nodes to this file throughout
this chapter.
Listing 13-3. config.xml - The Outline XML Structure
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns=" http://www.w3.org/ns/widgets "
xmlns:gap=" http://phonegap.com/ns/1.0 "
id="com.games.fakezee"
version="1.0.0">
<name>Fakezee</name>
<description>
Fakezee is a dice game that is fun for everyone!
</description>
<author href="" email="">
Fun Times Games
</author>
</widget>
A unique id is needed for your application and is set to the id attribute in the main widget node. This unique id
is crucial when it comes time to package your application for distribution. It is less important during the development
phase, which this chapter will cover, but just remember that this id must match certain provisioning files when
publishing to app stores.
 
Search WWH ::




Custom Search