Muliresolution question

Hi,

I have cocos2d-x and I’m working with the multiresolution

static Resource iPhoneResource = { cocos2d::CCSizeMake(320, 480), “iphone” };
static Resource iPhoneRetinaResource = { cocos2d::CCSizeMake(480, 960), “iphonehd” };
static Resource iPhone5Resource = { cocos2d::CCSizeMake(640, 1136), “iphone5” };
static Resource iPadResource = { cocos2d::CCSizeMake(768, 1024), “ipad” };
static Resource iPadRetinaResource = { cocos2d::CCSizeMake(1536, 2048), “ipadhd” };
static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(320, 480);

CCEGLView *pEGLView = CCEGLView::sharedOpenGLView();
CCSize frameSize = pEGLView~~>getFrameSize;
pEGLView~~>setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder);

if (frameSize.height > iPadResource.size.height && frameSize.height > 1136) {

CCFileUtils::sharedFileUtils()>setResourceDirectory;
pDirector
>setContentScaleFactor(iPadRetinaResource.size.width/designResolutionSize.width);

CCLog(“iPad Retina”);

} else if (frameSize.height > iPhoneRetinaResource.size.height && frameSize.height < 1136) {

CCFileUtils::sharedFileUtils()>setResourceDirectory;
pDirector
>setContentScaleFactor(iPadResource.size.width/designResolutionSize.width);
CCLog(“iPad”);

} else if (frameSize.height > iPhoneRetinaResource.size.height) {
CCFileUtils::sharedFileUtils()>setResourceDirectory;
pDirector
>setContentScaleFactor(iPhone5Resource.size.width/designResolutionSize.width);

CCLog(“iPhone 5”);

} else if (frameSize.height > iPhoneResource.size.height) {
CCFileUtils::sharedFileUtils()>setResourceDirectory;
pDirector
>setContentScaleFactor(iPhoneRetinaResource.size.width/designResolutionSize.width);

CCLog(“iPhone Retina”);
} else {

CCFileUtils::sharedFileUtils()>setResourceDirectory;
pDirector
>setContentScaleFactor(iPhoneResource.size.width/designResolutionSize.width);

CCLog(“iPhone”);
}

It seems to be detecting the resolution just fine. I did however name the files the same for each resolution. I’m noticing that sometimes in the simulator the images are huge, small, or normal depending on which device am I simulating. Is that because I named them all the same name in the different directories and it’s getting confused?

When adding folders to your XCode project you must use “create folder references for any added folders” instead “create groups for any added folders”.

Thanks! Yeah I figured that out late last night.

I appreciate the answer.