화면 조절에 관해서 setDesignResolutionSize

     

AppDelegate.cpp 에서 화면 크기를 강제로 조절할 수 있다. 


Size screenSize = glview->getFrameSize();

    glview->setDesignResolutionSize(768, 1024, kResolutionExactFit);

    


std::vector<std::string> searchPaths;

    if (screenSize.width > 768) {

        searchPaths.push_back("hd");

        CCFileUtils::sharedFileUtils()->setSearchPaths(searchPaths);

        director->setContentScaleFactor(2);

    }else{

        searchPaths.push_back("sd");

        CCFileUtils::sharedFileUtils()->setSearchPaths(searchPaths);

        director->setContentScaleFactor(1);

    }


추가로 레티나에서는 hd, 일반에서는 sd 리소스를 참조할 수 있도록 바꿀수 있다.


스택 오버플로우에서 가져옴. 

반응형

댓글

Designed by JB FACTORY