Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. // Import properly sized resources
  2. auto screenSize = director->getVisibleSize();
  3.  
  4. std::vector<std::string> searchPaths;
  5. if (screenSize.height <= SD_PIXEL_HEIGHT ) {
  6. searchPaths.push_back("SD");
  7. searchPaths.push_back("Fonts/SD");
  8. FileUtils::getInstance()->setSearchPaths(searchPaths);
  9. director->setContentScaleFactor(SD_PIXEL_HEIGHT/screenSize.height );
  10. } else if (screenSize.height <= HD_PIXEL_HEIGHT ) {
  11. searchPaths.push_back("HD");
  12. searchPaths.push_back("Fonts/HD");
  13. FileUtils::getInstance()->setSearchPaths(searchPaths);
  14. director->setContentScaleFactor(HD_PIXEL_HEIGHT/screenSize.height );
  15. } else {
  16. searchPaths.push_back("HDR");
  17. searchPaths.push_back("Fonts/HDR");
  18. FileUtils::getInstance()->setSearchPaths(searchPaths);
  19. director->setContentScaleFactor(HDR_PIXEL_HEIGHT/screenSize.height );
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement