当前位置: 首页>>代码示例>>C++>>正文


C++ FileUtils::setSearchResolutionsOrder方法代码示例

本文整理汇总了C++中FileUtils::setSearchResolutionsOrder方法的典型用法代码示例。如果您正苦于以下问题:C++ FileUtils::setSearchResolutionsOrder方法的具体用法?C++ FileUtils::setSearchResolutionsOrder怎么用?C++ FileUtils::setSearchResolutionsOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileUtils的用法示例。


在下文中一共展示了FileUtils::setSearchResolutionsOrder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onExit

void TestSearchPath::onExit()
{
    FileUtils *sharedFileUtils = FileUtils::getInstance();

    // reset search path
    sharedFileUtils->setSearchPaths(_defaultSearchPathArray);
    sharedFileUtils->setSearchResolutionsOrder(_defaultResolutionsOrderArray);
    FileUtilsDemo::onExit();
}
开发者ID:anilgulgor,项目名称:myGame,代码行数:9,代码来源:FileUtilsTest.cpp

示例2: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLView::create("My Game");
        director->setOpenGLView(glview);
    }

    glview->setDesignResolutionSize(768, 1024, ResolutionPolicy::EXACT_FIT);

    FileUtils* futils = FileUtils::getInstance();

    auto screensize = glview->getFrameSize();
    if(screensize.width > 768) {
        vector<string> dirs(1, "hd");
        futils->setSearchResolutionsOrder(dirs);
        director->setContentScaleFactor(2);
    }
    else {
        vector<string> dirs(1, "sd");
        futils->setSearchResolutionsOrder(dirs);
        director->setContentScaleFactor(1);
    }

    SimpleAudioEngine* augine = SimpleAudioEngine::getInstance();

    augine->preloadEffect(futils->fullPathForFilename("hit.wav").c_str());
    augine->preloadEffect(futils->fullPathForFilename("score.wav").c_str());

    // 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);

    // create a scene. it's an autorelease object
    auto scene = LogoLayer::createScene();

    // run
    director->runWithScene(scene);

    return true;
}
开发者ID:mxpang,项目名称:lab,代码行数:44,代码来源:AppDelegate.cpp


注:本文中的FileUtils::setSearchResolutionsOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。