Cocos Studio Multi Resolution

Hello!

Today is the first time I use Cocos Studio ever, I need to port one project from cocos2d to cocos2dx (ver. 3.8). So basically, android is involved :wink: Since I want to do everything correct from the beginning I have a question and if someone would explain it to me step by step (best with an example) this would be great.

So, I’m targeting 5 resolutions:

  1. 2560x1600
  2. 2048x1536 (ipad retina)
  3. 1920x1200
  4. 1280x800
  5. 1024x768 (ipad)

Now, can someone tell me how I should handle the multi resolution in cocos studio? What design resolution I should choose and how should it look like in code (the Appdelegate etc.) If someone could share a starting project he is using or something like this would be great and of course explain in easy steps how to handle such things :stuck_out_tongue:

Bump guys! :stuck_out_tongue:

At the moment I have something like this in my AppDelegate:

auto glview = director->getOpenGLView();

if(!glview) {
    glview = GLViewImpl::createWithRect("ResTest", Rect(0, 0, 2048, 1536));
    director->setOpenGLView(glview);
}

// turn on display FPS
director->setDisplayStats(true);

// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);

FileUtils::getInstance()->addSearchPath("res");

std::vector<std::string> searchResolutionsOrder(1);

cocos2d::Size targetSize = glview->getFrameSize();

if (targetSize.height < 1279.0f)
{
    searchResolutionsOrder[0] = "ipad";
    director->getOpenGLView()->setDesignResolutionSize(1024, 768, ResolutionPolicy::FIXED_WIDTH);
}
else if (targetSize.height < 1919.0f)
{
    searchResolutionsOrder[0] = "android";
    director->getOpenGLView()->setDesignResolutionSize(1280, 800, ResolutionPolicy::FIXED_WIDTH);
}
else if (targetSize.height < 2047.0f)
{
    searchResolutionsOrder[0] = "androidhd";
    director->getOpenGLView()->setDesignResolutionSize(1920, 1200, ResolutionPolicy::FIXED_WIDTH);
}
else if (targetSize.height < 2559.0f)
{
    searchResolutionsOrder[0] = "ipadhd";
    director->getOpenGLView()->setDesignResolutionSize(2048, 1536, ResolutionPolicy::FIXED_WIDTH);
}
else
{
    searchResolutionsOrder[0] = "androiduhd";
    director->getOpenGLView()->setDesignResolutionSize(2560, 1600, ResolutionPolicy::FIXED_WIDTH);
}

FileUtils::getInstance()->setSearchResolutionsOrder(searchResolutionsOrder);

But it takes the wrong assets all the time and I have no idea why :open_mouth:

Bump! :stuck_out_tongue: