Cocos Studio Resources Problems

Hi!

I have a problem with assets using Cocos Studio. I created a simple Resolution-Test project for different resolutions.

Now what I do:

  1. I put in the MainScene the test.png from the ipadhd folder since my design resolution is 2048x1536

  2. I save everything and publish to Xcode

  3. Cocos Studio publishes only the assets that are used so I copy the android/androidhd/androiduhd/ipad folders from cocosstudio to the Resource directory

  4. I change the code in AppDelegate.cpp to:

    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();

    glview->setDesignResolutionSize(2048, 1536, ResolutionPolicy::NO_BORDER);

    FileUtils::getInstance()->addSearchPath(“res”);

    std::vectorstd::string searchResolutionsOrder(1);

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

    if (targetSize.width < 1279.0f)
    {
    searchResolutionsOrder[0] = “ipad”;
    }
    else if (targetSize.width < 1919.0f)
    {
    searchResolutionsOrder[0] = “android”;
    }
    else if (targetSize.width < 2047.0f)
    {
    searchResolutionsOrder[0] = “androidhd”;
    }
    else if (targetSize.width < 2559.0f)
    {
    searchResolutionsOrder[0] = “ipadhd”;
    }
    else
    {
    searchResolutionsOrder[0] = “androiduhd”;
    }

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

This code works but it does NOT take the correct assets. Basically the problem is that the asset is ALWAYS taken from the ipadhd directory. If I create a scene in Cocos Studio and take the asset from androidhd then it takes ALWAYS from the androidhd directory. When I remove the lets call it “base” directory (so in my example the ipadhd folder) then there is a black screen, all other directories are being ignored.

Why is it so and how can I force the device to take the correct asset? I mean… there must be a way because if not then there is no point of putting assets for different resolutions in the app :frowning:
The above code works (it cuts the top and bottom edge) but I think it takes the 2048x1536 assets and scales them instead of taking the special prepared assets (lets say for example 1280x800) :frowning:
Thats why even a simple 2d game runs at 30fps instead of solid 60fps.

Bump! Anyone? :stuck_out_tongue:

I don’t think it’s possible in cocos studio, but I’m also interested in solution :smiley:

Up! up! up! I need a solution for this! :stuck_out_tongue:

I am interested in a solution too. It would be awesome to have multi-resolution support in Cocos Studio.

Yes, mutliresolution support is something they have to really work on in Cocos Studio.
@nite do you know if the cocos studio team is currently working on that?

I think currently for Cocos Studio with edge based positioning, you can create multi resolution based menus and if you’re using JS, definitely check out CocosCreator, it has great multi resolution support.

Here is the demo video in chinese, jump to 2:08 to see the multi resolution demo.

Cocos Creator looks very polished, but im not using javascript.
Cocos Studio layouting is good, but what i think is missing is the proper resource exporting.

A tighter integration with the projects resource folder is needed, e.g. i have my multi-resolution setup in appdelegate and load from different folders depending on resolution.
You should then be able to create your scenes in one resolution, and it will automatically map the right assets to it according to the asset folders you specified in appdelegate

I think Cocos Studio currently only uses the resources, that the scenes were made with, and doesn’t search any other folders.

I’m also not using javascript. I totally agree with @TheCodez this is one of two things that are missing in cocos studio (for me). The second one is custom sprite like in CocosBuilder.