本文整理汇总了C++中CButton::getTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::getTag方法的具体用法?C++ CButton::getTag怎么用?C++ CButton::getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::getTag方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onUserStone
void CQuickProduct::onUserStone(CCObject* pSender)
{
CButton *btn = (CButton*)pSender;
CPopTip *tip = (CPopTip*)btn->getParent()->getParent();
CCScaleTo *smal = CCScaleTo::create(0.2f,0.0f);
CCSequence *seque = CCSequence::createWithTwoActions(smal, CCCallFuncN::create(this,callfuncN_selector(CQuickProduct::removeTip)));
tip->runAction(seque);
if (btn->getTag()==1)
{
/*tip->removeFromParent();*/
// CPopTip *pop = CPopTip::create("tips/bg.png");
// pop->addBeforeImage("tips/blackbg.png",0,20);
// pop->addButton("public/btn_yellow_befor.png","public/btn_yellow_after.png",nullptr,3,1);
// pop->buttonAddImage("public/font_queiding.png",3);
// pop->addTextRichTip("沒有足夠的鑽石",ccWHITE,"Arail",18.0f);
// /*pop->addRichImage("mainCity/icon_11.png");*/
// pop->reloadTextRich(ccp(VCENTER.x,VCENTER.y+50));
//
// pop->setBottomOffset(-10);
// pop->setTouchEnabled(true);
// pop->setTouchPriority(-100);
// pop->setButtonLisener(this,ccw_click_selector(CQuickProduct::onUserStone));
// this->addChild(pop,10,2);
// pop->runScaleAction();
// ShowPopTextTip(GETLANGSTR(263));
}
LayerManager::instance()->pop();
LayerManager::instance()->pop();
}
示例2: showHelpTipsClick
void CDownloadPackage::showHelpTipsClick( CCObject *pSender )
{
//点击取消重启,点击确定下载新的apk
CButton *btn = (CButton*)pSender;
if (btn->getTag()==PopTipConfirm)
{
//确定
runAction(CCCallFunc::create(this, callfunc_selector(CDownloadPackage::callbackForRestart)));
}
}
示例3: onGarrsion
void CCommandLayer::onGarrsion(CCObject* pSender)
{
CButton *btn = (CButton*)pSender;
m_selectHero = btn->getTag();
vector<CHero> &heroList = m_city.heroList;
if (heroList.size()>=btn->getTag())
{
CHero hero = heroList[btn->getTag()-1];
CDefendWuJiang *layer =CDefendWuJiang::create();
layer->setCityId(m_city.id,m_city.cityId);
layer->setReplaceId(hero.id);
LayerManager::instance()->push(layer);
CPlayerControl::getInstance().sendHeroList(3);
}
else
{
CDefendWuJiang *layer =CDefendWuJiang::create();
layer->setCityId(m_city.id,m_city.cityId);
layer->setReplaceId(0);
LayerManager::instance()->push(layer);
CPlayerControl::getInstance().sendHeroList(3);
}
}
示例4: onExitGame
void BackLayer::onExitGame(CCObject* pSender)
{
CButton *btn = (CButton*)pSender;
if (btn->getTag()==PopTipConfirm)
{
CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
CCDirector::sharedDirector()->end();
}
else
{
LayerManager::instance()->pop();
m_backTip->removeFromParent();
m_backTip = nullptr;
}
}
示例5: onReturnLogin
void BackLayer::onReturnLogin(CCObject* pSender)
{
CButton *btn = (CButton*)pSender;
if (btn->getTag()==PopTipConfirm)
{
//销毁多余数据,确保不影响切换账号重新登录
DataCenter::destroy();
CTaskControl::getInstance()->resetGameTips();
CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
CNetClient::getShareInstance()->setIsCloseConn(true);
CCDirector::sharedDirector()->replaceScene(GETSCENE(LoginScene));
}
else
{
LayerManager::instance()->pop();
m_backTip->removeFromParent();
m_backTip = nullptr;
}
}
示例6: onClickDownloadPackage
void LoginLayerUC::onClickDownloadPackage( CCObject* pSender )
{
CButton* pBtn = (CButton*)pSender;
if(pBtn->getTag()==PopTipConfirm)
{
CDownloadPackage* pLayer = CDownloadPackage::create();
pLayer->setDownloadPacakgeDelegate(this);
CCDirector::sharedDirector()->getRunningScene()->addChild(pLayer, 1147);
pLayer->downLoadPackage();
}
else
{
//不更新,重启游戏,重复引导
//CJniHelper::getInstance()->restartGame();
CCDirector::sharedDirector()->end();
}
((CPopTip*)(pBtn->getParent()->getParent()))->removeFromParentAndCleanup(true);
}
示例7: onClick
void SetPanel::onClick(CCObject* ob)
{
CButton* btn = (CButton*)ob;
int tag = btn->getTag();
switch(tag)
{
case 1:
{
if(this->getParent())
this->getParent()->removeChild(this);
}
break;
case 2:
{
CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
//CSceneManager::sharedSceneManager()->getScene("CityScene")->release();
CCDirector::sharedDirector()->replaceScene(GETSCENE(LoginScene));
}
break;
case 3:
{
CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
CCDirector::sharedDirector()->end();
}
break;
case 4:
{
CCMessageBox(GETLANGSTR(1012), GETLANGSTR(1005));
//ShowTexttip(U8("此功能尚未开放,敬请期待"),RGB_RED);
}
break;
case 5:
{
CCMessageBox(GETLANGSTR(1012), GETLANGSTR(1005));
//ShowTexttip(U8("此功能尚未开放,敬请期待"),RGB_RED);
}
break;
default:
break;
}
}
示例8: onResignDay
void CSignLayer::onResignDay(CCObject *pSender)
{
CButton *btn = (CButton*)pSender;
if (btn->getTag()==PopTipConfirm)
{
//货币不足
if(!CheckGold(m_resignGold))
{
//ShowPopTextTip(GETLANGSTR(203));
CShowToBuyResource* pShow = CShowToBuyResource::create();
pShow->showToBuyResourceByType(ShowBuyResourceGold);
return;
}
else
{
m_bIsReSign = true;
CPlayerControl::getInstance().sendSignReq(m_bIsReSign);
}
}
((CPopTip*)(btn->getParent()->getParent()))->onClose(nullptr);
}