예제 #1
0
FMUIBooster::FMUIBooster() :
    m_parentNode(NULL),
    m_amountLabel(NULL),
    m_boosterIcon(NULL),
    m_boosterCount(NULL),
    m_willClose(false),
    m_recharging(false),
    m_unlockLabel(NULL),
    m_newBoostLabel(NULL)
{
    m_ccbNode = FMDataManager::sharedManager()->createNode("UI/FMUIBooster.ccbi", this);
    addChild(m_ccbNode);
    
    CCLabelBMFont * title = (CCLabelBMFont *)m_parentNode->getChildByTag(3);
#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID)
    title->setAlignment(kCCTextAlignmentCenter);
#endif
    
    NEAnimNode * booster = (NEAnimNode *)m_parentNode->getChildByTag(1);
    booster->releaseControl("Clock");
    booster->releaseControl("Booster");
    
    NEAnimNode * boosterIcon = (NEAnimNode *)booster->getNodeByName("Booster");
    m_boosterIcon = boosterIcon;
    
    NEAnimNode * boosterClock = (NEAnimNode *)booster->getNodeByName("Clock");
    boosterClock->setVisible(false);
    
    NEAnimNode * boosterCount = (NEAnimNode *)booster->getNodeByName("Count");
    boosterCount->releaseControl("Label", kProperty_StringValue);
    m_boosterCount = boosterCount;
    m_amountLabel = (CCLabelBMFont *)boosterCount->getNodeByName("Label");
    
    CCAnimButton * priceButton = (CCAnimButton *)m_parentNode->getChildByTag(15);
    priceButton->getAnimNode()->releaseControl("Label", kProperty_StringValue);

}
예제 #2
0
FMUIWorldMap::FMUIWorldMap() :
    m_parentNode(NULL),
//    m_rewardParent(NULL),
    m_giftButton(NULL),
    m_facebookButton(NULL),
    m_rewardAnim(NULL),
    m_isShown(false),
    m_isExpand(false),
    m_isBonusExpand(false),
    m_wxNode(NULL),
    m_dailyAnim(NULL),
    m_friendsAnim(NULL),
    m_inviteAnim(NULL),
    m_hasNewQuest(false),
    m_bookBtn(NULL),
    m_spinTimesLabel(NULL),
    m_spinButton(NULL),
    m_unlimitLifeAnim(NULL),
    m_iapGoldBonusAni(NULL),
    m_starRewardAni(NULL),
    m_bonusNode(NULL)
{
    m_ccbNode = FMDataManager::sharedManager()->createNode("UI/FMUIWorldMap.ccbi", this);
    addChild(m_ccbNode);
    
    CCBAnimationManager * manager = (CCBAnimationManager *)m_ccbNode->getUserObject();
    manager->setDelegate(this);
    
//    NEAnimNode * facebook = NEAnimNode::createNodeFromFile("FMUIButtonList.ani");
//    m_rewardParent->addChild(facebook, 1, 1);
    
    //init button list

#ifdef BRANCH_CN
//    CCControlButton * arrowButton = CCControlButton::create(CCScale9Sprite::create("transparent.png"));
//    arrowButton->setPreferredSize(CCSize(40, 21));
//    arrowButton->setAnchorPoint(CCPointZero);
//    arrowButton->addTargetWithActionForControlEvents(this, cccontrol_selector(FMUIWorldMap::clickMenuButton), CCControlEventTouchUpInside);
//    
//    p = facebook->getNodeByName("ButtonArrow");
//    p->addChild(arrowButton, 0, 1);
//    
//    CCControlButton * button1 = CCControlButton::create(CCScale9Sprite::create("transparent.png"));
//    button1->setPreferredSize(CCSize(37, 37));
//    button1->setAnchorPoint(CCPointZero);
//    button1->addTargetWithActionForControlEvents(this, cccontrol_selector(FMUIWorldMap::clickMenuButton), CCControlEventTouchDown);
//    
//    p = facebook->getNodeByName("Button1");
//    p->addChild(button1, 0, 3);
//    
//    CCControlButton * button2 = CCControlButton::create(CCScale9Sprite::create("transparent.png"));
//    button2->setPreferredSize(CCSize(37, 37));
//    button2->setAnchorPoint(CCPointZero);
//    button2->addTargetWithActionForControlEvents(this, cccontrol_selector(FMUIWorldMap::clickMenuButton), CCControlEventTouchDown);
//    
//    p = facebook->getNodeByName("Button2");
//    p->addChild(button2, 0, 4);
    CCLabelBMFont* label = (CCLabelBMFont*)m_friendsAnim->getNodeByName("Label");
    label->setWidth(m_widthForThreeCN);
    label->setAlignment(kCCTextAlignmentCenter);
    label->setLineBreakWithoutSpace(FMDataManager::sharedManager()->isCharacterType());
    
    label = (CCLabelBMFont*)m_rewardAnim->getNodeByName("Label");
    label->setWidth(m_widthForTwoCN);
    label->setAlignment(kCCTextAlignmentCenter);
    label->setLineBreakWithoutSpace(FMDataManager::sharedManager()->isCharacterType());
#ifdef BRANCH_CN
    m_rewardAnim->setVisible(!FMDataManager::sharedManager()->hasPurchasedUnlimitLife());
#endif

    
    
    label = (CCLabelBMFont*)m_dailyAnim->getNodeByName("Label");
    label->setWidth(m_widthForTwoCN);
    label->setAlignment(kCCTextAlignmentCenter);
    label->setLineBreakWithoutSpace(FMDataManager::sharedManager()->isCharacterType());
    
    label = (CCLabelBMFont*)m_inviteAnim->getNodeByName("Label");
    label->setWidth(m_widthForTwoCN);
    label->setAlignment(kCCTextAlignmentCenter);
    label->setLineBreakWithoutSpace(FMDataManager::sharedManager()->isCharacterType());
#endif

    CCSprite * tbg = CCSprite::createWithSpriteFrameName("UnreadMessage.png");
    tbg->setAnchorPoint(ccp(1, 1));
    tbg->setPosition(ccp(m_spinButton->getContentSize().width, m_spinButton->getContentSize().height));
    tbg->setScale(1.2f);
    m_spinButton->addChild(tbg);
    
    m_spinTimesLabel = CCLabelBMFont::create("", "font_7.fnt", 50, kCCTextAlignmentCenter);
    tbg->addChild(m_spinTimesLabel);
    m_spinTimesLabel->setPosition(ccp(tbg->getContentSize().width/2 - 0.5f , tbg->getContentSize().height/2 - 0.5f ));

    scheduleUpdate();
}