Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Import properly sized resources
- auto screenSize = director->getVisibleSize();
- std::vector<std::string> searchPaths;
- if (screenSize.height <= SD_PIXEL_HEIGHT ) {
- searchPaths.push_back("SD");
- searchPaths.push_back("Fonts/SD");
- FileUtils::getInstance()->setSearchPaths(searchPaths);
- director->setContentScaleFactor(SD_PIXEL_HEIGHT/screenSize.height );
- } else if (screenSize.height <= HD_PIXEL_HEIGHT ) {
- searchPaths.push_back("HD");
- searchPaths.push_back("Fonts/HD");
- FileUtils::getInstance()->setSearchPaths(searchPaths);
- director->setContentScaleFactor(HD_PIXEL_HEIGHT/screenSize.height );
- } else {
- searchPaths.push_back("HDR");
- searchPaths.push_back("Fonts/HDR");
- FileUtils::getInstance()->setSearchPaths(searchPaths);
- director->setContentScaleFactor(HDR_PIXEL_HEIGHT/screenSize.height );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement