Reputation: 1
I am trying on xcode to run our app on the simulator and check the screen height. I am using cocos2d, but i also have tried apple methods .
NSLog(@"HEIGT:%f",[UIScreen mainScreen].bounds.size.height);
//and also :
winSize = [[CCDirector sharedDirector] winSize];
NSLog(@"HEIGT:%f",winSize.Height);
both gives me height of 480 on the iPhone5 4 inch simulation . Why is that ? and how can i know if this is actually iPhone5 ?
Upvotes: 0
Views: 343
Reputation: 5107
In your project, take one image of having size 640*1136 and add to Retina image of launch images and you will actual size. You can check in print log also.
2013-04-22 13:10:56.510 test[7526:c07] cocos2d: cocos2d v1.0.1
2013-04-22 13:10:56.511 test[7526:c07] cocos2d: Using Director Type:CCDirectorDisplayLink
2013-04-22 13:10:56.654 test[7526:c07] cocos2d: OS version: 6.1 (0x06010000)
2013-04-22 13:10:56.654 test[7526:c07] cocos2d: GL_VENDOR: Apple Computer, Inc.
2013-04-22 13:10:56.655 test[7526:c07] cocos2d: GL_RENDERER: Apple Software Renderer
2013-04-22 13:10:56.655 test[7526:c07] cocos2d: GL_VERSION: OpenGL ES-CM 1.1 APPLE
2013-04-22 13:10:56.655 test[7526:c07] cocos2d: GL_MAX_TEXTURE_SIZE: 4096
2013-04-22 13:10:56.656 test[7526:c07] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2013-04-22 13:10:56.656 test[7526:c07] cocos2d: GL_MAX_SAMPLES: 4
2013-04-22 13:10:56.657 test[7526:c07] cocos2d: GL supports PVRTC: YES
2013-04-22 13:10:56.657 test[7526:c07] cocos2d: GL supports BGRA8888 textures: YES
2013-04-22 13:10:56.657 test[7526:c07] cocos2d: GL supports NPOT textures: YES
2013-04-22 13:10:56.658 test[7526:c07] cocos2d: GL supports discard_framebuffer: YES
2013-04-22 13:10:56.658 test[7526:c07] cocos2d: compiled with NPOT support: NO
2013-04-22 13:10:56.658 test[7526:c07] cocos2d: compiled with VBO support in TextureAtlas : YES
2013-04-22 13:10:56.659 test[7526:c07] cocos2d: compiled with Affine Matrix transformation in CCNode : YES
2013-04-22 13:10:56.659 test[7526:c07] cocos2d: compiled with Profiling Support: NO
2013-04-22 13:10:56.708 test[7526:c07] cocos2d: Frame interval: 1
2013-04-22 13:10:56.709 test[7526:c07] Application windows are expected to have a root view controller at the end of application launch
2013-04-22 13:10:56.709 test[7526:c07] cocos2d: surface size: 320x568
this is working fine for me.
Upvotes: 1
Reputation: 1730
Few days ago, I faced same problem and solution is....
set Launch Image for Retina (4-inch) with proper size.
Upvotes: 0