问题
I am little confused with cocos2d v3's support for multiple screen resolutions. If I use CCSetupScreenMode: CCScreenModeFlexible
, what should be the default resolution of the image that I provide?
Currently, I have provided assets for all the iOS device resolutions along with suffixes and the correct images are loaded on iPhone "3.5inch" and iPad. However, the "-568h@2x" suffix for iPhone "4 inch" is not working fine. Am i using the wrong suffix?
I would like to avoid the need to use macros to determine which device the game is running on and load the images accordingly.
Thank you for your time!
回答1:
The ScreenMode only defines if the screen scales up with the device size or not.
The fixed screen
mode provides you with a stage that has a safe area and an unsafe area but the complete stage always has the same size.
In the flexible screen mode
the root node of your scene will resize with the actual screen size, so you have to deal with dynamic sizing.
You can read more about the screen modes, image sizes and how to design a game for multiple screen resolutions in our tutorial.
In Cocos2D the suffixes are different from the ones UIKit uses. The suffixes are:
- -ipad
- -ipadhd
- -hd
- -iphone5hd
来源:https://stackoverflow.com/questions/22286153/multiple-screen-resolution-support-in-cocos2d-v3