在AppDelegate中设置资源查询目录HD目录看过来

AppDelegate中的

bool AppDelegate::applicationDidFinishLaunching()

{

。。。。。。

auto screenSize = glview->getFrameSize();


    auto designSize = Size(480, 320);


    auto fileUtils = FileUtils::getInstance();

    std::vector<std::string> searchPaths;

    

    if (screenSize.height > 320)

    {

        auto resourceSize = Size(960, 640);

        searchPaths.push_back("hd");

        searchPaths.push_back("ccs-res/hd");

        searchPaths.push_back("ccs-res/hd/scenetest");

        searchPaths.push_back("ccs-res/hd/scenetest/ArmatureComponentTest");

        searchPaths.push_back("ccs-res/hd/scenetest/AttributeComponentTest");

        searchPaths.push_back("ccs-res/hd/scenetest/BackgroundComponentTest");

        searchPaths.push_back("ccs-res/hd/scenetest/EffectComponentTest");

        searchPaths.push_back("ccs-res/hd/scenetest/LoadSceneEdtiorFileTest");

        searchPaths.push_back("ccs-res/hd/scenetest/ParticleComponentTest");

        searchPaths.push_back("ccs-res/hd/scenetest/SpriteComponentTest");

        searchPaths.push_back("ccs-res/hd/scenetest/TmxMapComponentTest");

        searchPaths.push_back("ccs-res/hd/scenetest/UIComponentTest");

        searchPaths.push_back("ccs-res/hd/scenetest/TriggerTest");

        searchPaths.push_back("ccs-res");

        director->setContentScaleFactor(resourceSize.height/designSize.height);

    }

    else

    {

        searchPaths.push_back("ccs-res");

        searchPaths.push_back("ccs-res/scenetest/ArmatureComponentTest");

        searchPaths.push_back("ccs-res/scenetest/AttributeComponentTest");

        searchPaths.push_back("ccs-res/scenetest/BackgroundComponentTest");

        searchPaths.push_back("ccs-res/scenetest/EffectComponentTest");

        searchPaths.push_back("ccs-res/scenetest/LoadSceneEdtiorFileTest");

        searchPaths.push_back("ccs-res/scenetest/ParticleComponentTest");

        searchPaths.push_back("ccs-res/scenetest/SpriteComponentTest");

        searchPaths.push_back("ccs-res/scenetest/TmxMapComponentTest");

        searchPaths.push_back("ccs-res/scenetest/UIComponentTest");

        searchPaths.push_back("ccs-res/scenetest/TriggerTest");

    }

    

    fileUtils->setSearchPaths(searchPaths);

。。。。。。}

看到了没。

你可能感兴趣的:(在AppDelegate中设置资源查询目录HD目录看过来)