本文整理汇总了C++中CCControlButton::getPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CCControlButton::getPosition方法的具体用法?C++ CCControlButton::getPosition怎么用?C++ CCControlButton::getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCControlButton
的用法示例。
在下文中一共展示了CCControlButton::getPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refreshWorldPad
void GamePan::refreshWorldPad()
{
CCNode* pBaseNode = m_pCcbNode->getChildByTag(kTagGamePanWordPan);
CCNode* tabNode = pBaseNode->getChildByTag(kTagGamePanWordPanTabBase);
CCNode* itemNode = pBaseNode->getChildByTag(kTagGamePanWordPanItemBase);
CCLabelTTF* itemTemp = dynamic_cast<CCLabelTTF*>(itemNode->getChildByTag(kTagGamePanWordPanItemTitle));
CCControlButton* tabItem = dynamic_cast<CCControlButton*>(tabNode->getChildByTag(kTagGamePanWordPanTabBaseItem));
float itemWidth = tabItem->getContentSize().width+ITEM_SPACE;
float itemHeight = tabItem->getContentSize().height+ITEM_SPACE;
for(int i =0;i<MAX_LINE;i++)
{
for(int j =0;j<MAX_ROW;j++)
{
CCControlButton* item = CCControlButton::create();
Utils::copyCCControlButton(item,tabItem);
item->setPosition(ccp(tabItem->getPositionX()+j*itemWidth,tabItem->getPositionY()-i*itemHeight));
item->setTag(j+i*MAX_ROW);
tabNode->addChild(item);
CCLabelTTF* title = Utils::copyCCLabelTTF(itemTemp);
title->setPosition(item->getPosition());
title->setTag(j+i*MAX_ROW);
itemNode->addChild(title);
CCString* str = (CCString*)_wordList->randomObject();
title->setString(str->getCString());
_wordList->removeObject(str);
}
}
for(int i =0;i<MAX_LINE;i++)
{
for(int j =0;j<MAX_ROW;j++)
{
CCControlButton* item = dynamic_cast<CCControlButton*>(tabNode->getChildByTag(j+i*MAX_ROW));
XCheckBox* pCheckBox = XCheckBox::create(item);
pCheckBox->setTag(item->getTag());
pCheckBox->setToggle(false);
pCheckBox->setTarget(this, cccontrol_selector(GamePan::wordSelectCallbackCCControl));
tabNode->addChild(pCheckBox);
item->removeFromParent();
}
}
itemTemp->removeFromParent();
tabItem->removeFromParent();
refreshLetter();
}