本文整理汇总了C++中ImageView::getChildByName方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageView::getChildByName方法的具体用法?C++ ImageView::getChildByName怎么用?C++ ImageView::getChildByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView::getChildByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initRoomItemCallback
void GameHallLayer::initRoomItemCallback(Widget* widget, MyRoomList room)
{
ImageView* img = static_cast<ImageView*>(UIHelper::seekWidgetByName(widget, "Image_back"));
ImageView* enter = static_cast<ImageView*>(img->getChildByName("Image_enter"));
Label* lblWord = static_cast<Label*>(enter->getChildByName("Label_word"));
Widget* panelFree = UIHelper::seekWidgetByName(widget, "Image_free_back");
string room_back;
string word;
int level = DataManager::sharedDataManager()->currLevel;
unsigned long long gold = DataManager::sharedDataManager()->currGold;
if (level >= room.roomLevelLimt && gold >= room.roomGoldLimt)
{
word = "进入";
room_back = CCString::createWithFormat("room%d.png",room.roomid)->getCString();
//显示免费转动次数
if (1 == room.roomid && DataManager::sharedDataManager()->currFreeNum > 0)
{
ImageView* freeIcon = static_cast<ImageView*>(UIHelper::seekWidgetByName(panelFree, "Image_free"));
Label* freeNum = static_cast<Label*>(UIHelper::seekWidgetByName(panelFree, "Label_freeNum"));
panelFree->setVisible(true);
freeIcon->loadTexture(CCString::createWithFormat("free%d.png",room.roomid)->getCString(),UI_TEX_TYPE_PLIST);
freeNum->setText(CCString::createWithFormat("x%d",DataManager::sharedDataManager()->currFreeNum)->getCString());
}
}
else
{
if (level < room.roomLevelLimt)
word = CCString::createWithFormat("%d级" , room.roomLevelLimt)->getCString();
else
word = CCString::createWithFormat("%lld万", room.roomGoldLimt / 10000)->getCString();
room_back = CCString::createWithFormat("room%d_grey.png",room.roomid)->getCString();
}
string room_btn = CCString::createWithFormat("button_room%d.png",room.roomid)->getCString();
enter->loadTexture(room_btn.c_str(),UI_TEX_TYPE_PLIST);
img->loadTexture(room_back.c_str(),UI_TEX_TYPE_PLIST);
lblWord->setText(word);
}