I have a problem with my application ios. It is a universal application of cocos2d 6.0. It works on ipad, iphone 3GS, 4, 4S. Iphone 5 on I can start the application but cocos2d does not use the entire screen. Like iPhone 4. Do you have any idea??
Thank's
Have you added to your project the Default-568h#2x.png launch image? This will make your app use the full iPhone 5 screen.
If you do not include that launch image, then your app will work in boxed mode (i.e., centered on screen with black bands above and below to fill the entire area).
Note : this is due to the devices different screen resolutions :
iPhone 4 : 960x640 px.
iPhone 5 : 1136x640 px.
This happens due to screen size differences between iphone5 and iphone 3G, 4, 4s.
iPhone 4 :960 x 640 px
iPhone 5 1136 x 640 px
You should use Default-568h#2x.png image name for your launch image. On starting iphone 5 will load this image which will cover whole screen, While for other images in your game(If you have different images for iPhone5) use following code in your AppDelegate.m
[CCFileUtils setiPhoneFourInchDisplaySuffix:#"your suffix"];
And place images in project according to your suffix.
Related
I am sure this info is somewhere but I can't find it, and the Apple Developer hotline seems to have no idea what I'm talking about. In the assets library for launch screen in Xcode, there are slots labeled:
iPhone Portrait ---> Retina HD 5.5 & Retina HD 4.7
iOS8
iPhone Portrait ---> 2x & Retina 4
iOS 7, 8
iPhone Portrait ---> 1x, 2x & Retina 4
iOS 5, 6
I had launch screens prepared and I have the sizes for these individual files, but I don't see how their sizes correspond to these Apple labels within Xcode. Moreover, the Apple docs here (https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html#//apple_ref/doc/uid/TP40011225-CH26-SW1 which is what Apple Developer referred me to) just refer to iphone 6 and 6s sizes, which doesn't correspond to the Xcode label organization.
This seems like it should be a 1 minute query. What am I missing and where is this super basic information?
If you select the image "slot" in the asset catalog and show the Attributes inspector (on the right-hand side), it will show (among other things) "Expected Size" for each image. Doing that, it looks like:
iPhone Portrait iOS8 Retina HD 5.5: 1242 x 2208
iPhone Portrait iOS8 Retina HD 4.7: 750 x 1334
In the Attributes inspector, you can also choose which "slots" you want included via a series of checkboxes.
Documentation-wise, see the Icon and Image Sizes section of the iOS Human Interface Guidelines.
Paraphrasing from there:
iPhone 6 Plus: Use a Launch File
iPhone 6: Use a Launch File
iPhone 5: 640 x 1136
iPhone 4s: 640 x 960
iPad (#2x): 1536 x 2048 (portrait), 2048 x 1536 (landscape)
iPad (#1x): 768 x 1024 (portrait), 1024 x 768 (landscape)
Also see the Launch Images section, which says:
Although it’s best to use a launch file for iPhone 6 and iPhone 6 Plus, you can
instead supply static launch images if necessary. If you need to create static
launch images for these devices, use the following sizes:
For iPhone 6:
750 x 1334 (#2x) for portrait
1334 x 750 (#2x) for landscape
For iPhone 6 Plus:
1242 x 2208 (#3x) for portrait
2208 x 1242 (#3x) for landscape
It's worth noting that if you're only supporting iOS 8, you can just use a launch XIB or Storyboard and you don't need to worry about particular images sizes. The Launch Images section has information on that.
My most recent app update (which is iOS 8 only) is using XIB files (one for iPhone, one for iPad) and it works great.
Retina HD 5.5 - 1242x2208
Retina HD 4.7 - 750x1334
Retina HD 5.5 landscape - 2208x1242
2x - 640x960
Retina 4 - 640x1136
1x - 320x480
default 320x568
default#x2 640x1136
So early when working with iPhone Retina and non-Retina, I used to handled images as "image.png" and "image#2X.png", and that used to do the trick in handling graphics.
But what I am facing now is that I am no more building for iPhone 3,3g,3gs. That means all images are for retina now, so the question is that how to handle iPhone 5,5c,5s images. As these devices vertical resolution is more than 960 pixels.
Do I need to make two separate image sets for iPhone 4,4s and iPhone 5,5c,5s?
no, you need not to make two separate image sets for iPhone 4 and iPhone 5 series, it's only issue if you want to have whole screen image for some backgrounds for example... different images only for start screens.
Edit:
icons and non-full screen graphics are probably the same on iPhone 4 & 5. For full screen wallpapers you need separate sets for different resolutions based on device here are the naming conventions you can use
image.png -> iPhone (non-retina)
image#2x.png -> iPhone 4s/4 (retina)
image-568h#2x.png -> iPhone 5
image~ipad.png -> iPad (non-retina)
image#2x~ipad.png -> iPad (retina)
refer this apple design guide and http://www.iosres.com
This is a little bit weird. Now, I am developing an app that's universal. However, I don't provide images for the iPad retina (iPad 3 and 4), but still retina images available for the iPhone. Now, the app uses the retina images of iPhone on iPad 3 and 4 instead of using the non retina, yet with correct size, iPad images.
To clear this out:
- iPad 1 and 2 uses the iPad non retina images (normal).
- iPad 3 & 4 uses the iPhone retina images instead of the iPad non retina images!
I tried a solution where I renamed the iPhone retina images so that it will end with ~iphone#2x. This fixes the issue on the iPad 3 and 4 but now the iPhone 4, 4s & 5 uses the non retina images!
IIRC, you got it the other way around. It should be myimage#2x~iphone.png.
if I changed app graphics for iphone 5 , is it going to work for iphone 4, 3GS properly or the users have to resize the app like when you download iphone app in iPad ?
If you mean you are using both normal sized images and 2x images for retina display, you won't have a problem on older devices.
They'll just pickup the regular sized images while the ones with retina display will load the #2x ones.
What you do have to take into account is that if you don't include regular sized images (if you only use #2x images), older devices won't load them.
#2X will still work. However I did download xcode 4.5 with iOS 6 Gold Master seeds and played with it last night. The splash screen will include the new slightly higher resolution image 11??x640 as well as the 960x640 and 480x360.
For fullscreen images, you will have to supply at least two versions, better three.
One being 640 × 1136, one being 640 x 960 and one being 320 x 480.
For the 3.5" retina version, you may use the automatic selection (aka #2x). For the former 4" retina version it appears as if you will have to include your own code to select the right one.
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.