Esempio n. 1
0
FloatWord* FloatWord::create(const std::string& word,const int fontSize,Point begin){
	FloatWord* ret = new FloatWord();
	if(ret && ret->init(word,fontSize,begin)){
		ret->autorelease();
		return ret;
	}
	CC_SAFE_DELETE(ret);
	return nullptr;
}
Esempio n. 2
0
void GameLayer::gotoGameOver(){
	
	GAMEDATA::getInstance()->saveHighestScore();
	
	Size visibleSize = Director::getInstance()->getVisibleSize();
	FloatWord* gameOver = FloatWord::create(
		"GAME OVER",40,Point(visibleSize.width,visibleSize.height/2));
	this->addChild(gameOver);
	gameOver->floatIn(1.0f,[]{Director::getInstance()->replaceScene(MenuScene::create());});
}
Esempio n. 3
0
FloatWord* FloatWord::create( const std::string& fonts,const int fontSize,Vec2 begin )
{
	FloatWord* pRet = new FloatWord();
	if (pRet && pRet->init(fonts,fontSize,begin))
	{
		pRet->autorelease();
		return pRet;
	}
	else
	{
		CC_SAFE_DELETE(pRet);
		return nullptr;
	}
}