Cocos2d-x v3.x … そろそろマジ勉強したい…
ということで4日目… ^^; …まぁ無理せずがんばろう…
Cocos2d-x v3 C++ Tutorial 4 – Multi Resolution Support
https://www.youtube.com/watch?v=CH9Ct4R0nBM
解像度か…これは勉強しなくては… ^^;
相変わらず英語がわからないからチンプンカンプンww
自分…マジヤバい状況を実感^^;
とりあえず Resourcesフォルダに iphonehdフォルダを作成し、fontフォルダ以外のリソースを iphonehdフォルダに移動して、
cocos2d-xの /tests/cpp-empty-test/Resources にある ipad, ipadhd, iphone フォルダをコピー
xcodeでリソースの追加(Create folder references for any added folders を選択)
ここから AppDelegate.cpp を編集する事になるけど、動画の画面が小さくてコードが読めないww
cocos2d-x v3系のマルチ解像度対応(iOS限定)はこんな感じ?
{ auto fileUtils = FileUtils::getInstance(); auto screenSize = glview->getFrameSize(); std::vector<std::string> resDirOrders; if ((2048 == screenSize.width) || (2048 == screenSize.height)) { resDirOrders.push_back("ipadhd"); resDirOrders.push_back("ipad"); resDirOrders.push_back("iphonehd"); resDirOrders.push_back("iphone"); //glview->setDesignResolutionSize(2048, 1536, ResolutionPolicy::NO_BORDER); glview->setDesignResolutionSize(1024, 768, ResolutionPolicy::NO_BORDER); } else if ((1024 == screenSize.width) || (1024 == screenSize.height)) { resDirOrders.push_back("ipad"); resDirOrders.push_back("iphonehd"); resDirOrders.push_back("iphone"); glview->setDesignResolutionSize(1024, 768, ResolutionPolicy::NO_BORDER); } else if ((1136 == screenSize.width) || (1136 == screenSize.height)) { resDirOrders.push_back("iphonehd"); resDirOrders.push_back("iphone"); //glview->setDesignResolutionSize(1156, 640, ResolutionPolicy::NO_BORDER); glview->setDesignResolutionSize(568, 320, ResolutionPolicy::NO_BORDER); } else if ((960 == screenSize.width) || (960 == screenSize.height)) { resDirOrders.push_back("iphonehd"); resDirOrders.push_back("iphone"); //glview->setDesignResolutionSize(960, 640, ResolutionPolicy::NO_BORDER); glview->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER); } else { resDirOrders.push_back("iphone"); glview->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER); } fileUtils->setSearchPaths(resDirOrders); }
…あれ…ipad…ちょっと違うな…