iPhone SDK: Splash Screen Stretching - iphone

I have a splash screen in my app which is working fine other than the fact that the image seems to stretch slightly vertically when loaded.
The image is 320 x 460.
Any idea why the stretch is occurring?

That's because the splash screen size should be 320 × 480 (esp. if the status bar is hidden).
(You should also prepare a 640 × 960 one (Default#2x.png) for iPhone 4. You need to provide 2 or 3 more images if you need to support iPad as well. See http://developer.apple.com/library/ios/#qa/qa2010/qa1588.html for detail.)

Related

Cocos2d v2 CCSprite Background Image dimension

I have created a new Cocos2d project and I deleted the 'Hello World' label. I have added this image (320x480 px) and tested on iPhone 4, here is the result. The image's dimensions have been reduced to 1/4th of their original size, not sure what's going on. I never had this problem before with the previous version.
Source Image
Screen Shot from iPhone 4
You should enable retina display if it's not already enabled:
[director enableRetinaDisplay:YES];
And provide the retina version of the background image using the "-hd" suffix.
backgroundImage.png (320 x 480 px)
backgroundImage-hd.png (640 x 960 px)
By the way you can set your own suffix:
#define CC_RETINA_DISPLAY_FILENAME_SUFFIX #"-hd"
The reason is that iPhone 4 and 4S have retina displays - a display with a 4 times higher resolution as the previous models. Cocos2D, as opposed to iOS, doesn't use logical but physical screen sizes - you need to load another image with a 4 times higher resolution on iPhone 4 and 4S.

Desiging Websites for Retina style devices: What dimensions should you use when designing?

The dimensions of the iPhone is 320x480
The dimensions of a Retina iPhone is 640x960
When designing a design for a retina device, do you set the size of your document to 320 x 480 or 640 x 960?
I would have thought you would have set the size to 320 x 480.
The reason for this is that although a retina device has more pixels, these are still being displayed on a 3" screen size. If you did set your size to 640 x 960, then when viewed on a retina display, all the text would be small, as although there are more pixels, the screen isn't physically bigger.
Is that correct?
UPDATED: Do you also use 320 x 480 as a base size for CSS (see comments below)
Yes, that's correct. I'm an iOS developer, not a web designer, but in iOS devices you specify everything in points (which is one pixel on a non-retina device, and a 2x2 pixel block on a retina device) so everything is the same size. The extra pixels on the retina display simply make everything look better.
You can get away with smaller text on a retina screen since you have more detail, but accessibility wise that's not a good move, since lots of people can't then see your text without zooming, whatever kind of display they have.

How to set the size and background of splash screen for universal app

I am using Default.png for iPhone and Default-Landscape.png for ipad. But in case of ipad the splash screen shows only half of the image and rest is cut. It seems to be the size of image becomes double of what it should be. I am using image with width:525 and height:175 for ipad.
I also added:
UILaunchImageFile~ipad Default-Landscape.png
in my info.plist file. What might be the problem? Please guide me....
Also can i set the backgroung of splash screen to white????
The landscape iPad launch image has to be 1024x748 pixels. That's the only size that will prevent your image from scaling.
I guess the iPad tries to scale your image to a height of 748 which means the width will be 2244px. Not exactly double but something like four times the size of what you want.
Create a white image with dimensions of 1024x748 and put your 525x175 image in the middle of it.
Try the image name Default#2x.png and size would be 1024X768....

background image size iphone

Normal background image is 320x480 pixels. and for retina is 640x960 pixels.
Now i have to put my background image and i have status bar(20) and navigation bar (44).
So i have to reduce 64(20+44) from 480(normal) or from 960(retina)?
if i reduce 64 from normal then normal image will be 320x416 pixels and retina will be 640x832 pixels.
if i reduce 64 from retina then normal will be 320x448 and retina will be 640x896 .
It is confusing me.. this 64(20+44) i reduce from which image type because other one will be exactly half or double of it.
Reduce from the normal size.
64px = height to remove from normal display.
128px = height to remove from the retina.
Don't forget that in the retina display the status bar and nav bar will also be 2x the height :)
You do everything based upon the 320x480 size, then retina scales everything up. Using images suffixed #2x will allow you to replace the assets (mainly UIImage) for the retina version, this doesnt work for direct resource file references or video/audio files though so just be careful.
So measure for 320 for all your assets then your retina ones will simply be twice the size

splash (launch image) in landscape mode?

I am developing a game which works only in landscape mode. When I import a launch image (Default.png) into my xcode proj and run it, the image appears in portrait mode and then the view starts in landscape mode. How can I make my splash/launch image be displayed in landscape mode only?
First thing is no one is gonna know from outside the application that application is gonna run in portrait or landscape.
If at all you still want to view the splash screen in landscape mode you have to design the image in such a way as we cannot change the behaviour of the splash screen.
Instead of designing the image as 320X480, design it as 480X320 and your problem will get solved.
hAPPY cODING...
Always create 320x480 and 640x960 sized pictures. Just name them Default.png and Default#2x.png. As Michael Kessler notes, to have them appear in landscape, you have to rotate the graphics in your gfx editor.
I quote Apple docs as they look as of now:
iPhone and iPod touch
Portrait 320 x 480 pixels, 640 x 960 pixels (#2x)
Landscape Not supported
iPad
Portrait 768 x 1004 pixels, 1536 x 2008 pixels (#2x)
Landscape 1024 x 748 pixels, 2048 x 1496 pixels (#2x)
http://developer.apple.com/library/ios/DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html#//apple_ref/doc/uid/TP40007072-CH6-SW12
So you can see that landscape orientation of images are not supported for iPhone/iPod.