My cocos2D app, Forever Afloat, works perfectly fine with all the combinations until you get to iPhone 5 and iOS6!
The app display is all stretched out so that you see only the lower left corner and the rest is off the screen.
Only until you force it to autorotate, does the app begin to display at proper dimensions...
My problems can also be found at this problem cocos2D iOS 6 retina display
They asked the same question.
Any solutions?
Thanks!
cocos2d uses image with image-hd.png and not image#2x.png
Check whether you are using #2x an replace by hd
Use new version of cocos2d and here is image extension.
-wide.png for iphone 5
-widehd.png for iPhone 5 HD
-hd.png for iPhone HD
-ipad.png for iPad.
-ipadhd.png for iPad HD.
There were some issues within the AppDelegate regarding the order of calls that made the display all strange. All I did was move the initalization method to the top and it fixed everything!
Related
I have already created an app compatible with ios<5. Which already exists at Workout DJ FREE for Spotify
Now in next version I want this app compatible with ios5 too. For that what do I need to do?
I have planned to go with either of these two options
Make separate xib for each screen
Create all images with more retina display & name it with #(some)X. Like we do #2x for retina display.
I don't think the 2nd option will work at all, will it?
I'm seeking guidance from the ios5 experts.What should I do? Should I go with either of above two options or there is some other alternative that is standard & best.
You shouldn't need separate views for the iPhone 5 and <= iPhone 4.
Just add a new Default screen for the iPhone 5 to trigger automatic view sizing to work on the iPhone 5 and make sure all of your Autolayout or resizing masks are correct.
Yes, you'll want to make sure you supply retina graphics so everything looks good on the retina displays in the iPhone 4 and iPhone 5.
Just follow the below tutorial. You will have idea of how to set design for iPhone 4 & 5 compatible.
http://mobile.tutsplus.com/tutorials/iphone/working-with-the-iphone-5-display/
Cheers.
There are multiple ways of doing this, try googling it. Maybe try checking out this forum article here: http://forums.macrumors.com/showthread.php?t=1356952
I have an application in iphone market which works for iPhone 4s and lower version. So now iPhone 5 has been launched which bigger size screen, my question is what all changes i have to do in my application so that it will be compatible with iPhone 5 also.
1) Do i have to rebuild my app for iPhone 5?
2) Do i have to make changes only in UI ?
3) Will the iPhone 5 will its make it compatible?
Your valuable replies will help me a lot. Thanks in advance.
Here is my answers,
1) Do i have to rebuild my app for iPhone 5?
If you want to utilize the complete screen space, you can add Default-568h#2x.png and rebuild the app and release it.
2) Do i have to make changes only in UI ?
You can utilize the complete screen space for iphone 5. You can code for screen modifications in case of other iPhones.
3) Will the iPhone 5 will its make it compatible?
Yes. It will make it automatically compatible. It will add a black strip on top and bottom to compensate for the extra space in the screen unless you add Default-568h#2x.png.
If your app uses the standard UIKit provided by Apple, you only need to add a 4 inch launch image to your app, and it will automatically resized itself. But if your app using custom controls or graphics-heavy like in games, you might want to adjust the images and take advantage of the larger screen.
You also have to make sure the methods you used do not deprecated on iOS6 to prevent the app from crashing. Some references if you need further reading.
To make older app compatible with iPhone 5 You need to look for Following things.
Latest Xcode version 4.5.
Open your project and select Upgrade settings for new version.
Add Default-568h#2x.png for new resolution .
For UI you have to change your xib's object autoresizing property.When you select View Go to
inspector and select size property It will show you None, Full Screen, Retina 4 options . Set autoresize property for all your Buttons , labels and check xib for retina 4 and None both.It is same like you set it for Landscape and portrait .
5.Some other changed will be in code because some method has been depreciated for ios 6.0.
6. After doing all this .You can run it on iphone 5 simulator for testing.
I have an app that was using GLKMatrix3 and its supporting functions. I found that the GLKMatrix3Multiply function would always crash on iPhone 5 hardware. Easy to workaround using GLKMatrix4 instead, but the point is that I would never have found the problem without actually trying my app on iPhone 5 hardware.
I was told to file a bug for the GLKMatrix3 problem, so maybe this will be fixed. But the code runs just fine in the iOS 6 simulator.
I learned from this that, whether or not you need to rebuild your app for iPhone 5, you do need to at least run your app on a device before advertising support for that device.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
Do any adjustments need to be made for an app started in development prior to the iphone 5 in order for them to work on the iphone 5's larger screen?
If so, what are these changes, or where can I find what to change? google hasn't been too helpful so far.
Thanks
After adding the Default-568h#2x.png launch image, follow the steps outlined in this post:
How to develop or migrate apps for iPhone 5 screen resolution?
If you are having issues with the images being used INSIDE the app, and you want to support iPhone 5 and pre-iPhone 5 devices, use this:
Dealing with different size images in a xib for iPhone5 versus iPhone4?
You need to add a default launch images with 640x1136px named Default-568h#2x.png to support the iPhone 5 screen.
First, you have to have a 640x1136 launch image (with -568h#2x.png suffix) to make it compatible with the iPhone 5, but to fully make use of the larger screen, there are a many ways to do it. I find the easiest way to do it is to make two separate storyboards, making a new one for the iPhone 5, while maintaining the one you have already used for the iPhone 4S, 4, etc. Using two storyboards removes the necessity for AutoLayout; enabling AutoLayout, it is good to note, also removes iOS 5 compatibility. Use the code in this answer to get started.
Depending on how your app views are laid out, you may not need to make too many changes. If you have views that resize and are anchored correctly, such as scroll views or table views, they will expand to fill the additional space on the iPhone 5 screen. You need to add an additional launch image for the new screen size too.
the iphone 5's screen is taller so you'd need to have images with a resolution of 1136x640 also included in your images folder. (add -568h#2x at the end of image's filenames)
also, everytime you will adjust your sprites and everything else that goes on the screen, you will need to account for the iphone 5 separately, just like you account for the ipad and the iphone (non retina and retina).
I'm developing a game using cocos2d. It's running now on iPhone and also supports Retina display. With retina i'm using images with "-hd" postfix. Now i want my application to be able to work on iPad using this images. How can i do that ?
PS: I don't have a real iPad and can only use a simulator. I will test the game on my friend's iPad after it will work well on a simulator. Is it possible to use hi-res images with simulator and how to do it?
I'm using cocos2D 0.99.5
inside CCFileUtils.m
inside method name +(NSString*) getDoubleResolutionImage:(NSString*)path
edit if( CC_CONTENT_SCALE_FACTOR() == 2)
to if( CC_CONTENT_SCALE_FACTOR() == 2 || (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad))
this will make the app to load the -hd image when running on ipad, remember to change your app targeted device family to iPhone/iPad.
this will solve the loading of -hd problem for ipad.
but after loading -hd file for ipad resolution, you will also notice that most of your image position should be off alignment, now either you go directly into the cocos2d folder to edit how CCNode,CCSprite,CClabel handle the positioning of thing or you code it in your code checking if its ipad or not.
if you are using CCSpriteBatchNote. this will also cause another problem because you will be reading from the -hd SpriteSheet. so the texture Rect u set to cut need to be double too.
another method is position everything according to winsize. i haven try this method.
I don't exactly understand the question but I will try to answer.
You can technically use the same graphics for the iPad, but they will not look as nice. For one, they will all blurry and pixelated, and two, the iPad has a different screen aspect ratio that the iPhone/iPod Touch. If you do make separate images for an iPad version of your game, it will not be extremely difficult to do. If you want to do this, I suggest posting a new question.
I just finish my iPhone game using cocos2d. But before I put it on the AppStore, I'd like to make it work on iPad (which have a bigger screen) and iPhone 4 (which have a bigger resolution).
So, how can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4, to be able to use the correct coordinates / images in my game?
Thanks for your help!
Between iPad and iPhone — Already answered many times.
Between iPhone and iPhone 4 — The size reported is still 320×480, so you don't need to change anything about the coordinates. Create an #2x alternative for the images if you need a high resolution UI image.