PopupLayer* PopupLayer::create(HelloWorld* const & parent) { PopupLayer* pPopupLayer = new PopupLayer(parent); pPopupLayer->init(); pPopupLayer->autorelease(); return pPopupLayer; }
PopupLayer* PopupLayer::createGameoverLayer(int gameType, int score) { PopupLayer *layer = new PopupLayer(); if (layer && layer->init()) { layer->autorelease(); layer->initGameoverLayer(gameType, score); return layer; } CC_SAFE_DELETE(layer); return NULL; }
PopupLayer* PopupLayer::createSuspendLayer(int gameType) { PopupLayer *layer = new PopupLayer(); if (layer && layer->init()) { layer->autorelease(); layer->initSuspendLayer(gameType); return layer; } CC_SAFE_DELETE(layer); return NULL; }
PopupLayer* PopupLayer::create(string pBackgroundImage, string pExitNormalImage, string pExitSelectedImage, const Point &pExitPostion) { PopupLayer *pRet = new PopupLayer(); pRet->init(pBackgroundImage, pExitNormalImage, pExitSelectedImage, pExitPostion); pRet->autorelease(); return pRet; }
PopupLayer* PopupLayer::create(Layer * targetLayer,const int type) { PopupLayer* popupLayer = new PopupLayer(); if (popupLayer && popupLayer->init(targetLayer, type)) { popupLayer->autorelease(); return popupLayer; } else { CC_SAFE_DELETE(popupLayer); return nullptr; } }