Cocos2d does not use iphone 5 full screen

I have a problem with my ios app. This is a universal cocos2d 6.0 application. It works on ipad, iphone 3GS, 4, 4S. Iphone 5, I can run the application, but cocos2d does not use the full screen. Like iPhone 4. Do you have any ideas?

Thanks x

+4
source share
2 answers

Have you added the default startup image to your project: 568h@2x.png ? This will force your application to use the full screen of the iPhone 5.

If you did not enable this launcher image, your application will work in boxed mode (that is, in the center of the screen with black bars at the top and bottom to fill the entire area).

Note. This is due to the fact that devices have different screen resolutions:
iPhone 4: 960x640 px.
iPhone 5: 1136x640 px.

+9
source

This is due to differences in screen size between iphone5 and iphone 3G, 4, 4s.

iPhone 4: 960 x 640 px

iPhone 5 1136 x 640 px

For the startup image, you should use the default image name: 568h@2x.png. When starting iphone 5 will download this image, which will cover the entire screen. Although for other images in your game (if you have different images for iPhone5), use the following code in AppDelegate.m

[CCFileUtils setiPhoneFourInchDisplaySuffix:@"your suffix"]; 

And put the images in the project according to your suffix.

+1
source

Source: https://habr.com/ru/post/1443181/


All Articles