Game Development Reference
In-Depth Information
Figure A-9 shows an error dialog that is triggered when an image of an incorrect size is dragged into
the application icon spot in Xcode. Even though a simple drag-and-drop interface is provided, it can
actually be a little tricky to get all of the images formatted correctly. This is tricky because there is
incorrect information about image sizes on most websites, including Apple's. I hope that by the time
you are reading this, Apple has fixed this problem on its site. Table A-2 list the correct image sizes
for each support image.
Table A-2. Support Image Sizes
Device
Icon
Launch (Portrait)
Launch (Landscape)
iPhone 3GS, iPod Touch 3
57x57
320x480
NA
iPhone 4, iPod Touch 4
114x114
640x960
NA
iPad1 + 2, iPad min
72x72
768x1024
1024x768
iPad 3 rd /4 th Generation
144x144
2048x1536
1536x2048
Once you create the files in the correct size, you can drag them into the appropriate spots on Xcode.
Xcode will automatically copy the files into the project directory (if required) and add the files to the
project. Older versions of iOS relied on a naming convention to specify which file was which. This
was pretty buggy and hard to maintain. The newer versions of iOS and Xcode allow you to name
your files anything you want. Listing A-2 shows how this information is represented in our
info.plist file.
Listing A-2. Sample A-Info.plist
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>my_icon_file.png</string>
<string>my_icon_file_retina.png</string>
<string>my_icon_file_ipad.png</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
In Listing A-2, we see that the filenames are simply stored in an array. The names of files are the
names I gave them, and they can be anything—they are not names assigned by Xcode.
We have looked at two examples of how we can have a single logical image, but with a few different
versions of it at different resolutions. The following section talks briefly about how best to create the
same image at different resolutions.
 
 
Search WWH ::




Custom Search