示例#1
0
void ShopDialogEntry::onEnter()
{
	cocos2d::Node::onEnter();

	CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
	animationManager->setDelegate(this);
}
示例#2
0
void SinglePlayerScene::onEnter()
{
    cocos2d::Node::onEnter();

    CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
    animationManager->setDelegate(this);

    setKeyboardEnabled(true);

    if (!m_enterred)
    {
        _playerSprite->setSpriteFrame(StringUtils::format("%ssteady.png", m_framePrefix.c_str()));
        auto bg = Director::getInstance()->getTextureCache()->addImage(m_game->getBackground());
        _background->setTexture(bg);

        this->setupPhysics();

        this->setupListeners();

        if (!m_game->isPracticeMode())
        {
            m_game->getPlayer()->addPlays(1);
        }
    }

    m_enterred = true;
}
示例#3
0
void Explosion::onNodeLoaded(cocos2d::CCNode * pNode, cocos2d::extension::CCNodeLoader * pNodeLoader)
{
  CCBAnimationManager* animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
  if (animationManager) {
    animationManager->setDelegate(this);
  }
}
示例#4
0
void HowToPlayScene::onExit()
{
	cocos2d::Node::onExit();

	CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
	animationManager->setDelegate(NULL);

}
示例#5
0
void ComicsScene::onExit()
{
	cocos2d::Layer::onExit();

	CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
	animationManager->setDelegate(NULL);

}
示例#6
0
void AboutMenu::onExit()
{
	cocos2d::Node::onExit();

	CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
	animationManager->setDelegate(NULL);

    UI_LOCK_MANAGER_DECREASE();
}
示例#7
0
void SinglePlayerScene::onExit()
{
    cocos2d::Node::onExit();

    CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
    animationManager->setDelegate(NULL);

    UNOBSERVE(this);
}
示例#8
0
void SettingsDialog::onEnter()
{
	cocos2d::Node::onEnter();

	CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
	animationManager->setDelegate(this);

	this->setKeyboardEnabled(true);
    
    UI_LOCK_MANAGER_INCREASE();
}
示例#9
0
int BasicPanel::LuaRemoveAnimationDelegate(lua_State *L)
{
    CCBAnimationManager* pManager = NULL;
    
    XYLOG_FAILED_JUMP(lua_gettop(L) == 0);
    
    pManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
    pManager->setDelegate(NULL);
Exit0:
    return 0;
}
示例#10
0
void HowToPlayScene::onEnter()
{
	cocos2d::Node::onEnter();

	CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
	animationManager->setDelegate(this);

	this->setKeyboardEnabled(true);
    
    m_currentPage = 0;
    
    this->fixArrows();
}
示例#11
0
void ComicsScene::onEnter()
{
	cocos2d::Layer::onEnter();

	CCBAnimationManager *animationManager = dynamic_cast<CCBAnimationManager*>(this->getUserObject());
	animationManager->setDelegate(this);

	this->setKeyboardEnabled(true);

    if (IS_SOUND_ENABLED)
    {
    	PLAY_SOUND("pageflip.mp3");
    }
}
示例#12
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();
}
示例#13
0
void BasicPanel::SetAnimationDelegate()
{
	CCBAnimationManager* pManager	= dynamic_cast<CCBAnimationManager*>(this->getUserObject());
	pManager->setDelegate(this);
}