I've been building a vertical scroller for the iPhone. I took a huge background image and chopped it up into 3 CCSprites in which I later stitched together. That worked seamlessly, but now that 0.99.5 brought retina display support everything is sort of off. The problem is the @2x images are larger than allowed, but just using the originals basically cuts makes everything half of it's original size. Here's another problem I found, It just told me that my images where too big, even after I deleted and cleared my cache???
0.99.5 Retina Display Support, CCSprite question
(8 posts) (5 voices)-
Posted 1 year ago #
-
The release-notes say that it's not recommended to use the @2x suffix...
You should be using the "-hd" suffix instead of "@2x" in the files that you import.so "sprite@2x.png" should be "sprite-hd.png".
Posted 1 year ago # -
Unfortunately that doesn't work either. It keeps telling me that the image is to large even if there is no image.
Posted 1 year ago # -
What exactly is telling you your image is too large? I don't see that error in the Cocos2d source.
Posted 1 year ago # -
I'm getting that message in the debugger when it crashes. Up until I upgraded my version of cocos everything was fine. Now when I test using the retina simulator (or iPhone 4) it crashes. The release notes mention that if an "-hd" version of the image isn't found then, by default, it should use the original. The way my game is set up I could either use a tileMap or a CCSprite's based of the same image as the tileMap. But even though my images are 512x2000 it keeps telling me that they are double that resolution (1024x4000), therefore they cannot be loaded. Even if I remove the images from the project, when the system attemps to load them it says the same thing. Even though the resolution is different now, other than the sprites, everything else should pretty much work exactly the same, correct? Any ideas guys?
Posted 1 year ago # -
@pob21: I have a few items you should check.
On occasion, both the simulator and device may hold on to old assets, even if you've deleted them (which might explain the problem even after you removed the images from the project).
First, clean EVERYTHING.
For XCode: navigate to your project folder through Finder. Delete the subfolder named "Build". XCode will re-create it next time you build your project.
For the simulator: Use the drop-down menu to "Reset Content and Settings" (I think that's the name.
For the device: Delete the app from the device, and let it delete any additional files, if there is a second prompt.Also, have you verified that the retina display mode has been enabled in your App Delegate? If you haven't, that is the only thing I can think of that would cause a problem with an image larger than 1024x1024. ( See the Programming Guide here: http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:how_to_develop_retinadisplay_games_in_cocos2d#enabling_retina_display_mode )
One other thing I have to ask - when you upgraded cocos (I'm assuming to .99.5), did you build a new project and import your custom code into it? There were changes in the way the template code (AppDelegate, etc) handled retina and device rotation. If you kept your prior version's App Delegate, you might not have all the new bits-n-bobs that make .99.5 support retina display. (I know there were substantial changes between .99.4 and .99.5, and pulling the rest of your code into a new template is probably the quickest way to upgrade.)
Posted 1 year ago # -
This happens a lot with the simulator. Just stop the app and delete it from the simulator (you know, find it on one of the app pages, hold it down till the X shows and hit it to delete it). Then rebuild and run it.
If you use folder references instead of groups, you will find this happens more often.
Posted 1 year ago # -
That did it, i got so sick of seeing that damn error haha, thanks a lot guys!
Posted 1 year ago #
Reply
You must log in to post.