Cocos2d - Default iPhone5 support with -wide / -widehd not working

我与影子孤独终老i 提交于 2019-12-13 04:21:40

问题


I believe now Cocos2D 2.1 and above Support iPhone5 with image extension -widehd.png

I used same but not working in my game. Just searched in cocos2d and found these in CCFileUtils.h

- iPhone: ""
- iPhone HD: "-hd"
- iPhone5 : "-wide"
- iPhone5 HD: "-widehd"
- iPad: "-ipad"
- iPad HD: "-ipadhd"
- Mac: ""
- Mac HD: "-machd"

This indicates now by default cocos2d support iPhone5. Why not working for me?


回答1:


CCFileUtils has the option to search resources in folders without using Suffix, and it's more clean than the suffix. To do that change the search mode from suffix to directory by using the following code:

CCFileUtils *sharedFileUtils = [CCFileUtils sharedFileUtils];
[sharedFileUtils setSearchMode:kCCFileUtilsSearchDirectoryMode];

Then, create at least one of the following folders:

resources-iphone5hd (for iPhone 5 retina resources )
resources-iphone5 (for iPhone 5 non-retina resources )
resources-iphonehd (for iPhone retina resources )
resources-iphone (for iPhone non-retina resources )
resources-ipadhd (for iPad retina resources )
resources-ipad (for iPad non-retina resources )
resources-mac (for OS X resources)
resources-machd (for OS X retina resources. N/A yet)



回答2:


In Cocos2d 3.0 its working with -iphone5hd extension

   imageName-iphone5hd.png  // For iPhone5 wide screen image


来源:https://stackoverflow.com/questions/16161297/cocos2d-default-iphone5-support-with-wide-widehd-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!