void FMUIWorldMap::updateUnlimitLifeDiscountUI() { #ifndef BRANCH_CN return; #endif FMDataManager* manager = FMDataManager::sharedManager(); CCLabelBMFont* label = NULL; m_unlimitLifeAnim->releaseControl("Label", kProperty_StringValue); label = (CCLabelBMFont*)m_unlimitLifeAnim->getNodeByName("Label"); CCString* timeStr = manager->getUnlimitLifeDiscountRestTimeStr(); label->setVisible( !(strcmp(timeStr->getCString(), "")==0) ); label->setString(timeStr->getCString()); }
bool SecondLevel::init() { if (!CCLayer::init()) { return false; } isRemoved = false; isDone = false; CCSize winSize = CCDirector::sharedDirector()->getVisibleSize(); CCSprite *bg = CCSprite::createWithTexture(IMAGEPOOL->textureForKey("/pic/background.png")); bg->setPosition(ccp(winSize.width / 2, winSize.height / 2)); this->addChild(bg, 0); rule_img = CCSprite::createWithTexture(IMAGEPOOL->textureForKey("/pic/level2.png")); rule_img->setPosition(ccp(winSize.width / 2, winSize.height / 2)); rule_img->setScale(0.4f); rule_img->setTag(10); this->addChild(rule_img, 1); forward_button = CCSprite::createWithTexture(IMAGEPOOL->textureForKey("/pic/forward.png")); forward_button->setPosition(ccp(350, forward_button->getContentSize().height / 2 + CCDirector::sharedDirector()->getVisibleOrigin().y)); rule_img->addChild(forward_button); key_img = CCSprite::createWithTexture(IMAGEPOOL->textureForKey("/pic/level2_key_face.png")); key_img->setPosition(ccp(winSize.width / 2, winSize.height / 2)); key_img->setVisible(false); this->addChild(key_img, 1); candidatite_img = CCSprite::createWithTexture(IMAGEPOOL->textureForKey("/pic/level2_condaditate_faces.png")); candidatite_img->setPosition(ccp(winSize.width / 2, winSize.height / 2)); candidatite_img->setScale(0.5f); candidatite_img->setVisible(false); this->addChild(candidatite_img, 1); result = CCSprite::createWithTexture(IMAGEPOOL->textureForKey("/pic/result.png")); result->setPosition(ccp(winSize.width / 2, winSize.height / 2)); result->setVisible(false); this->addChild(result, 1); CCSprite *back = CCSprite::createWithTexture(IMAGEPOOL->textureForKey("/pic/back.png")); back->setPosition(ccp(60, 100)); back->setScale(0.7f); result->addChild(back); CCLabelBMFont *lbLife = CCLabelBMFont::create("20", "/word/font09.fnt"); lbLife->setAnchorPoint(ccp(0, 1)); lbLife->setScale(0.6f); lbLife->setPosition(ccp(winSize.width - 70, winSize.height - 1)); lbLife->setVisible(false); this->addChild(lbLife, 1, 15); this->setTouchEnabled(true); this->setTag(0); return true; }