本文整理汇总了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();
}
示例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;
}