コード例 #1
0
ファイル: PopupFactory.cpp プロジェクト: ricolynx/Reflex
Popup* PopupFactory::createGameOverPopup(std::shared_ptr<Delegate> resetDelegate, std::shared_ptr<Delegate> quitDelegate)
{
    cocos2d::CCSize worldSize = cocos2d::CCDirector::sharedDirector()->getWinSize();
    
    std::vector<std::string>  buttonsImages = {"retry","quitbig"};
    std::vector<std::shared_ptr<Delegate>> delegates = {resetDelegate,quitDelegate};
    
    Popup *p = Popup::create();
    p->initPopup(worldSize.width - 300,
                 worldSize.height - 200 ,
                 buttonsImages ,
                 delegates,
                 "Game Over!",
                 100,
                 ""
                 );
    
    
    return p;

}
コード例 #2
0
ファイル: PopupFactory.cpp プロジェクト: ricolynx/Reflex
Popup* PopupFactory::createPausePopup(std::shared_ptr<Delegate> continueDelegate, std::shared_ptr<Delegate> quitDelegate)
{
    //std::cout << "Create popup pause"<< std::endl;
    
    cocos2d::CCSize worldSize = cocos2d::CCDirector::sharedDirector()->getWinSize();
    
    std::vector<std::string>  buttonsImages = {"play","quitbig"};
    std::vector<std::shared_ptr<Delegate>> delegates = {continueDelegate,quitDelegate};
    
    Popup *p = Popup::create();
    p->initPopup(worldSize.width - 300,
                 worldSize.height - 200 ,
                 buttonsImages ,
                 delegates,
                 "PAUSE",
                 100,
                 ""
                 );

    
    return p;
}