本文整理汇总了C++中BaseSprite::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseSprite::getParent方法的具体用法?C++ BaseSprite::getParent怎么用?C++ BaseSprite::getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseSprite
的用法示例。
在下文中一共展示了BaseSprite::getParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: select
void GongJiang_EquipSelect::select()
{
CCTableViewCell* lastCell = mTableView->cellAtIndex(0);
if (lastCell)
{
BaseSprite* bg = (BaseSprite*)lastCell->getChildByTag(TAG_EquipBaseBody_TABLE_ITEM);
bool isFirstIn = false;
// 先不管是否点击了图片
if(GameGuideManager::getManager()->isGuideNow(GameGuideManager::GID_GongJiang_QiangHua))
{
//GameGuideManager::getManager()->setOneGuideStart(GameGuideManager::GID_GongJiang_SelectZhuangBei);
//GameGuideManager::getManager()->setOneGuideEnd(GameGuideManager::GID_GongJiang_SelectZhuangBei);
if (bg)
{
CCPoint pos = bg->getParent()->convertToWorldSpace(bg->getPosition());
GuideLayerBase *guideLayer1 = new GuideLayer_SimpleLayer;
guideLayer1->init(bg->getContentSize(), ccp(pos.x,pos.y + bg->getContentSize().height / 2)
, LFStrings::getValue("qiangxuanzezhuangbei"), NULL, false);
//((GuideLayer_SimpleLayer*)guideLayer1)->setCallBack(this,SEL_CallFunc(&JiuGongGeLayer::GuiDeLayerCallBack));
CCDirector::sharedDirector()->getRunningScene()->addChild(guideLayer1, 128);
}
}
}
}
示例2: menuItemClicked_choseHero
void MainLayerHerosBaseBody::menuItemClicked_choseHero(CCObject* pSender)
{
BaseSprite* bg = (BaseSprite*)((CCMenuItemImage*)pSender)->getParent()->getParent();
CCTableViewCell* cell = (CCTableViewCell*)bg->getParent();
int idx = cell->getIdx();
if(mChoseHeroState[idx]>=1 && mChoseHeroState[idx]<=4)
{
mChoseHeroState[idx] = 0;
--mChoseNum;
// mTableView->reloadData();
for(int i=0; i!=mHerosVec.size(); ++i)
mTableView->updateCellAtIndex(i);
}
else if(mChoseHeroState[idx] == 0 && mChoseNum<3)
{
int temp[4] = {false};
int chessboard;
for(int i=0; i!=mChoseHeroState.size(); ++i)
if(mChoseHeroState[i]>=1 && mChoseHeroState[i]<=4)
temp[mChoseHeroState[i]-1] = true;
for(int i=0; i!=4; ++i)
if(! temp[i])
{
if(MyselfManager::getManager()->getMyZhuJueData()->getChessBoardPos() == i+1)
continue;
chessboard = i+1;
break;
}
mChoseHeroState[idx] = chessboard;
++mChoseNum;
// mTableView->reloadData();
for(int i=0; i!=mHerosVec.size(); ++i)
mTableView->updateCellAtIndex(i);
}
}