设置资源路径

 1   CCSize szFrame = CCEGLView::sharedOpenGLView()->getFrameSize();
 2     CCLog("%f,%f",szFrame.width, szFrame.height);
 3      if (szFrame.height == 1136)
 4      {
 5          std::vector<std::string> dir;
 6          dir.push_back("bg5");
 7          CCFileUtils::sharedFileUtils()->setSearchPaths(dir);
 8      }
 9      else
10      {
11          std::vector<std::string> dir;
12          dir.push_back("bg4");
13          CCFileUtils::sharedFileUtils()->setSearchPaths(dir);
14          szFrame.width = 640;
15          szFrame.height = 960;
16      }
17     //BTNBACK = szFrame.height / 2 - 34;
18     //CCLog("%f,%f",szFrame.width, szFrame.height);
19     
20   CCEGLView::sharedOpenGLView()->setDesignResolutionSize(szFrame.width, szFrame.height, kResolutionShowAll);

 

posted @ 2014-04-10 17:35  无语男  阅读(79)  评论(0)    收藏  举报