本文整理汇总了C++中CCMenuItemToggle::getTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCMenuItemToggle::getTag方法的具体用法?C++ CCMenuItemToggle::getTag怎么用?C++ CCMenuItemToggle::getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCMenuItemToggle
的用法示例。
在下文中一共展示了CCMenuItemToggle::getTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clickToggleCallBack
void IOSStoreLayer::clickToggleCallBack(CCObject* pObj)
{
CCLog("menutoggle call back");
CCMenuItemToggle* pToggle = (CCMenuItemToggle*)pObj;
int iTag = pToggle->getTag();
int index = pToggle->getSelectedIndex();
switch (iTag)
{
case kaibaoxiang_toggle_tag:
{
m_iCurShowNodeIndex = kaibaoxiang_node_index;
if (m_enumComeFrom == from_GameInSuperTool)
{
this->setComefrom(m_enumComeFrom);
}
else if (m_enumComeFrom == from_SeasonSelector)
{
this->setComefrom(m_enumComeFrom);
}
else if (m_enumComeFrom == from_MarketStore)
{
this->setComefrom(m_enumComeFrom);
}
else if (m_enumComeFrom == from_GameInHelpMap)
{
this->setTipBgVisible(true);
}
this->setLeftTopTipStrVisible(true);
this->setADVisible(false);
}
break;
case buystar_toggle_tag:
{
m_iCurShowNodeIndex = buystar_node_index;
this->setLeftTopTipStrVisible(false);
this->setTipBgVisible(false);
this->setADVisible(true);
}
break;
default:
break;
}
this->setToggleStateByNodeIndex(m_iCurShowNodeIndex);
if (index == 1)
{
if (m_iCurShowNodeIndex == buystar_node_index)
{
this->replaceLayer(m_pKaibaoxiangNode, m_pBuyStarNode, this, SEL_CallFuncN(&IOSStoreLayer::setTableViewVisble));
}
else
{
this->replaceLayer(m_pBuyStarNode, m_pKaibaoxiangNode, this, SEL_CallFuncN(&IOSStoreLayer::setTableViewVisble));
}
}
}
示例2: connectToSwitch
void NotificationCenterTest::connectToSwitch(CCObject *sender)
{
CCMenuItemToggle* item = (CCMenuItemToggle*)sender;
bool bConnected = item->getSelectedIndex() == 0 ? false : true;
Light* pLight = (Light*)this->getChildByTag(item->getTag()-kTagConnect+kTagLight);
pLight->setIsConnectToSwitch(bConnected);
}
示例3: menuItemCall
void MallMarkets::menuItemCall(cocos2d::CCObject *pSender)
{
CCMenuItemToggle *temp = (CCMenuItemToggle*)pSender;
CCLog("getTag :%d",temp->getTag());
//PropMarketsLayer *layerMarket = NULL;
if (!layerMarket) {
layerMarket = PropMarketsLayer::create();
this->addChild(layerMarket, 1);
}
layerMarket->setTag(1135);
//fubi = server prop = player
if (((CCMenuItemToggle*)pSender)->getTag() == 1122) {
if (togglePlayer->getSelectedIndex() == 1) {
togglePlayer->setSelectedIndex(0);
this->getChildByTag(1135)->setVisible(false);
this->getChildByTag(1136)->setVisible(true);
toggleServer->setEnabled(false);
togglePlayer->setEnabled(true);
}
else{
togglePlayer->setSelectedIndex(1);
this->getChildByTag(1135)->setVisible(true);
this->getChildByTag(1136)->setVisible(false);
}
}
//prop = player fubi = server
if (((CCMenuItemToggle*)pSender)->getTag() == 1133) {
if (toggleServer->getSelectedIndex() == 1) {
toggleServer->setSelectedIndex(0);
this->getChildByTag(1135)->setVisible(false);
this->getChildByTag(1136)->setVisible(true);
}
else{
toggleServer->setSelectedIndex(1);
toggleServer->setEnabled(true);
togglePlayer->setEnabled(false);
this->getChildByTag(1135)->setVisible(true);
this->getChildByTag(1136)->setVisible(false);
}
}
}