Hi all,
I have changed my last game to “cocos2d-2.0-x-2.0.4” to support various resolutions, but the game is not scaled to the correct screen, I mean:
My code is:
static Resource smallResource = { cocos2d::CCSizeMake(320, 480), “iphone” };
static Resource mediumResource = { cocos2d::CCSizeMake(640, 960), “iphonehd” };
static Resource largeResource = { cocos2d::CCSizeMake(720, 1080), “hd” };
static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(720, 1080);
pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionShowAll);
if (frameSize.width <= smallResource.size.width) {
CCFileUtils::sharedFileUtils()>setResourceDirectory;>setContentScaleFactor(smallResource.size.width/designResolutionSize.width);
pDirector
} else if (frameSize.width <= mediumResource.size.width) {
CCFileUtils::sharedFileUtils()>setResourceDirectory;>setContentScaleFactor(mediumResource.size.width/designResolutionSize.width);
pDirector
} else {
CCFileUtils::sharedFileUtils()>setResourceDirectory;>setContentScaleFactor(largeResource.size.width/designResolutionSize.width);
pDirector
}
And the device is 480x854 so the chosen resolution will be mediumResource but when the game is launched, the screen only shows a zone of the game screen, I mean, the resolution 640x960 is not rescaled to 480x854… Does anyone know how to solve it?
Thank you!