Cocos2d app works on all devices except iPhone 4 (any OS) where CCBatchnode shows black screen after addchild

I have been on this site for a long time and this is my first time posting a question. I'll try to be as descriptive as possible, as hopefully someone can answer this strange behavior I have.

I developed Linsanity Rush app for iPhone and I tested it on iPhone Simulator (Normal / Mesh), iPad Simulator, iPad2 iOS 5.0.1, iPhone 4S and everything works fine. However, some iPhone 4 users have complained about the game showing a black screen apart from the mute and pause button after pressing the game start button.

Xcode version - 4.2.1 Mac version 10.7.2 Cocos2d version cocos2d v2.0.0-beta p>

I tested about this on different OS on iPhone 4 and everyone had the same problem. I checked my code and I found out that the graphics I add using CCBatchnode just shows a black screen. This explains why users can only see the mute and pause button as those 2 buttons are not addChild using CCBatchnode.

More info about this issue, I'm not sure if it is a CCBatchNode issue because I used CCBatchNode in the main menu and iPhone 4 Users can see images in the main menu, the problem only occurs when they enter a game that is in a different source file and I replace the scene with the game.

However, I've searched the net for a long time and can't find anything similar to me that only happens on the iPhone 4. Anyone who knows how to solve this please help me. I am ready to provide additional information upon request. I have absolutely no idea what might be causing this, so I have no idea how much of the source code I should post here. Thanks, advanced!

+3


source to share


1 answer


I found the answer to this problem. I used to just test Iphone 4S and iPad2. When I am testing iPhone 4 and 3GS, I get a message in Xcode showing that:

cocos2d: WARNING: The image (1024 x 4096) is larger than the supported 2048 x 2048.



This is because if I want to support iPhone 3GS or iPhone 4, the image I create with Zwoptex cannot be larger (2048 x 2048) (the one currently using 4096 x 4096). I solved this by creating some sprites and dividing the images into a smaller list.

Hopefully if someone who has the same problem knows how to solve this.

+1


source







All Articles