Reputation: 9219
My iphone app has two images: "cat.png" and "[email protected]"
I heard that if we want to display bigger image (for iPad version), then you give name as "@2x.png" & it automatically detects device & display bigger image in iPad.
Is that true? If yes, I have done the same thing, but it does not display "[email protected]" when I check in iPad.
What could be wrong?
NOTE: I know there are post discussing this thing for icon.png BUT in my case I am refering to all images.
Upvotes: 0
Views: 4783
Reputation: 6360
@2x is the extension for the iPhone 4 retina display. You want to store two versions of the image if you are releasing your app for the iPhone. e.g. [email protected] and myimage.png.
Excerpt:
Standard: <ImageName><device_modifier>.<filename_extension>
High resolution: <ImageName>@2x<device_modifier>.<filename_extension>
The
<ImageName>
and<filename_extension>
portions of each name specify the usual name and extension for the file. The<device_modifier>
portion is optional and contains either the string~ipad
or~iphone
.You include one of these modifiers when you want to specify different versions of an image for iPad and iPhone. The inclusion of the
@2x
modifier for the high-resolution image is new and lets the system know that the image is the high-resolution variant of the standard image.
Upvotes: 3
Reputation: 22305
The iPad has insufficient RAM to support iPhone pseudo-emulation with the @2x
graphics, so the OS won't choose them automatically (as @Joseph Tura explained).
There are some techniques you can use to get the iPad to user higher-resolutions graphics while supporting both iPhone 4 Retina Display resolution and pre-iPhone-4 resolution, but it requires you do write all of the image substitution code yourself.
Matt Rix, creator of the excellent Trainyard games, explains how he did it inside Cocos 2D in a series of two posts: Retinafy Your Game and High-res graphics in Cocos2D. If you play the iPhone-only (not Universal) Trainyard and Trainyard Express on your iPad, the graphics look great and don't have the pixel-doubled jaggy look because his code swaps in specific graphics if the iPhone game is being played on the iPad.
Even if you're not using Cocos 2D for game development, the same basic structure applies. I recommend taking a look.
Upvotes: 2