本文整理汇总了C++中CButton::getSelectedImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::getSelectedImage方法的具体用法?C++ CButton::getSelectedImage怎么用?C++ CButton::getSelectedImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::getSelectedImage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEnter
void CSharpTollgate::onEnter()
{
BaseLayer::onEnter();
CButton* pClose = CButton::create("common/back.png", "common/back.png");
pClose->getSelectedImage()->setScale(1.1f);
pClose->setPosition(VLEFT+50, VTOP-50);
pClose->setOnClickListener(this,ccw_click_selector(CSharpTollgate::onClose));
this->addChild(pClose, 999);
m_cell = (CLayout*)(m_ui->findWidgetById("Cell"));
// m_cell->retain();
// m_ui->removeChild(m_cell);
CCAnimation *bgAnim = AnimationManager::sharedAction()->getAnimation("8055");
bgAnim->setDelayPerUnit(0.05f);
CCSprite *bg = createAnimationSprite("skill/8055.png",VCENTER,bgAnim,true);
bg->setScale(3.0f);
m_ui->addChild(bg);
m_tableView = (CTableView *)(m_ui->findWidgetById("scroll"));
m_tableView->setDirection(eScrollViewDirectionHorizontal);
m_tableView->setSizeOfCell(m_cell->getContentSize());
//m_tableView->setSizeOfCell(CCSizeMake(790,115));
m_tableView->setCountOfCell(0);
m_tableView->setBounceable(false);
m_tableView->setDataSourceAdapter(this,ccw_datasource_adapter_selector(CSharpTollgate::tableviewDataSource));
m_tableView->reloadData();
}
示例2: updateOpenState
void CMainCityUI::updateOpenState(CityData *cityData)
{
int size = cityData->cityList.size();
for (int i = 0; i <size; i++)
{
CCity *city = &cityData->cityList.at(i);
//是否刚打开功
bool justOpen = false;
if (city->cityId>20)
{
justOpen = CMainCityControl::getInstance()->isJustOpen(city);
}
if ((city->cityId>20&&!city->isOpen)||justOpen)
{
CCNode *child = m_ui->getChildByTag(city->cityId-20);
if (child)
{
CButton *btn = dynamic_cast<CButton*>(child->getChildByTag(city->cityId-20));
if (btn)
{
//btn->setEnabled(false);
btn->getNormalImage()->setShaderProgram(ShaderDataMgr->getShaderByType(ShaderStone));
btn->getSelectedImage()->setShaderProgram(ShaderDataMgr->getShaderByType(ShaderStone));
}
}
}
m_cityMap[city->cityId] = *city;
}
}
示例3: onEnter
void CVipCard::onEnter()
{
BaseLayer::onEnter();
//确定
CButton* pConfirm = (CButton*)m_ui->findWidgetById("confirm");
pConfirm->setOnClickListener(this, ccw_click_selector(CVipCard::onConfirm));
CButton* cancel = (CButton*)m_ui->findWidgetById("cancel");
cancel->setOnClickListener(this, ccw_click_selector(CVipCard::onCancel));
CButton* pClose = CButton::create("common/back.png", "common/back.png");
pClose->getSelectedImage()->setScale(1.1f);
pClose->setPosition(VLEFT+50, VTOP-50);
pClose->setOnClickListener(this,ccw_click_selector(CVipCard::onClose));
this->addChild(pClose, 999);
CImageViewScale9* pRect1 = (CImageViewScale9*)m_ui->findWidgetById("rect1");
m_cardText = CursorTextField::textFieldWithPlaceHolder("", FONT_NAME, 29, CCSize(690, 110), ccBLACK);
m_cardText->setPriority(this->getTouchPriority());
m_cardText->setLimitNum(17);
m_cardText->setAnchorPoint(ccp(0, 0.5f));
m_cardText->setPosition( ccp(pRect1->getPositionX()-440, pRect1->getPositionY()));
m_ui->addChild(m_cardText, 999);
//展示区图片
CLayout *pShowInfo = CLayout::create();
CScrollView *pScroll = (CScrollView*)m_ui->findWidgetById("scroll_info");
pScroll->setDirection(eScrollViewDirectionVertical);
pScroll->setBounceable(false);
pScroll->getContainer()->addChild(pShowInfo);
CCSize size = CCSize(957, 471);
pShowInfo->setContentSize(size);
pScroll->setContainerSize(size);
pShowInfo->setPosition(ccp(pScroll->getContainerSize().width*0.5f, pScroll->getContainerSize().height*0.5f));
pScroll->setContentOffsetToTop();
//嫁接内容
CLayout* pLayout = (CLayout*)findWidgetById("layer_info");
pLayout->retain();
pLayout->removeFromParent();
pShowInfo->addChild(pLayout);
pLayout->release();
pLayout->setPosition(ccp(size.width/2, size.height/2+10));
}
示例4: onEnter
void CSignLayer::onEnter()
{
BaseLayer::onEnter();
//签到grid的cell
m_cell = (CLayout*)(m_ui->findWidgetById("Cell"));
m_cell->retain();
m_ui->removeChild(m_cell);
m_gridView = (CGridView*)m_ui->findWidgetById("scroll");
m_gridView->setDirection(eScrollViewDirectionVertical);
m_gridView->setCountOfCell(0);
m_gridView->setSizeOfCell(m_cell->getContentSize());
m_gridView->setAnchorPoint(ccp(0,0));
m_gridView->setColumns(5);
m_gridView->setAutoRelocate(false);
m_gridView->setDeaccelerateable(true);
m_gridView->setDataSourceAdapter(this,ccw_datasource_adapter_selector(CSignLayer::gridviewDataSource));
m_gridView->reloadData();
m_signLay = (CLayout*)(m_ui->findWidgetById("Sign"));
//退出
CButton* pClose = CButton::create("common/back.png", "common/back.png");
pClose->getSelectedImage()->setScale(1.1f);
pClose->setPosition(VLEFT+50, VTOP-50);
pClose->setOnClickListener(this,ccw_click_selector(CSignLayer::onClose));
this->addChild(pClose, 999);
//book
CCheckBox* pBook = (CCheckBox*)(m_ui->findWidgetById("book"));
pBook->setOnCheckListener(this,ccw_check_selector(CSignLayer::showHeroBook));
//按钮补签
CButton* pResign = (CButton*)m_ui->findWidgetById("buqian_btn");
pResign->setOnClickListener(this, ccw_click_selector(CSignLayer::onBtnResignDay));
//按钮签到
CButton* pSign = (CButton*)m_ui->findWidgetById("qiandao_btn");
pSign->setOnClickListener(this, ccw_click_selector(CSignLayer::onBtnSignDay));
GetTcpNet->registerMsgHandler(SignDataMsg,this, CMsgHandler_selector(CSignLayer::ProcessMsg));
GetTcpNet->registerMsgHandler(SignReqMsg,this, CMsgHandler_selector(CSignLayer::ProcessMsg));
}
示例5: updateFuctionOpen
void CMainCityUI::updateFuctionOpen(const TMessage& tMsg)
{
int tag = tMsg.nMsg;
if (tag>20)
{
CCNode *child = m_ui->getChildByTag(tag-20);
if (child)
{
CButton *btn = dynamic_cast<CButton*>(child->getChildByTag(tag-20));
if (btn)
{
btn->setEnabled(true);
btn->getNormalImage()->setShaderProgram(ShaderDataMgr->getShaderByType(ShaderDefault));
btn->getSelectedImage()->setShaderProgram(ShaderDataMgr->getShaderByType(ShaderDefault));
}
}
}
}
示例6: onEnter
void CHandBookPanel::onEnter()
{
BaseLayer::onEnter();
//选项卡
CRadioBtnGroup *radioGroup = (CRadioBtnGroup *)m_ui->findWidgetById("radio");
for (unsigned int i=0; i<HandBookTabMax; i++)
{
CRadioButton *radioBtn= (CRadioButton*)(radioGroup->getChildByTag(i));
radioBtn->setOnCheckListener(this,ccw_check_selector(CHandBookPanel::onSwitchBtn));
}
//退出
CButton* pClose = CButton::create("common/back.png", "common/back.png");
pClose->getSelectedImage()->setScale(1.1f);
pClose->setPosition(VLEFT+50, VTOP-50);
pClose->setOnClickListener(this,ccw_click_selector(CHandBookPanel::onClose));
this->addChild(pClose, 999);
//默认选择一个
selectTabPanel(HandBookTabHero);
}
示例7: onEnter
void CStrengthenItem::onEnter()
{
BaseLayer::onEnter();
m_cell = (CLayout*)(m_ui->findWidgetById("Cell"));
m_cell->retain();
m_ui->removeChild(m_cell);
m_tableView = (CTableView *)(m_ui->findWidgetById("scroll"));
m_tableView->setDirection(eScrollViewDirectionVertical);
m_tableView->setSizeOfCell(m_cell->getContentSize());
m_tableView->setCountOfCell(0);
m_tableView->setBounceable(false);
m_tableView->setDataSourceAdapter(this,ccw_datasource_adapter_selector(CStrengthenItem::tableviewDataSource));
m_tableView->reloadData();
CButton *select = (CButton*)(m_ui->findWidgetById("select"));
select->setOnClickListener(this,ccw_click_selector(CStrengthenItem::onSelectItem));
CButton *filter = (CButton*)(m_ui->findWidgetById("filter"));
filter->setOnClickListener(this,ccw_click_selector(CStrengthenItem::onFilterItem));
//退出
CButton* pClose = CButton::create("common/back.png", "common/back.png");
pClose->getSelectedImage()->setScale(1.1f);
pClose->setPosition(VLEFT+50, VTOP-50);
pClose->setOnClickListener(this,ccw_click_selector(CStrengthenItem::onClose));
this->addChild(pClose, 999);
m_selectCellImg = (CCSprite*)m_ui->findWidgetById("selimg");
m_selectCellImg->retain();
GetTcpNet->registerMsgHandler(RoleBag,this,CMsgHandler_selector(CStrengthenItem::recItemData));
GetTcpNet->registerMsgHandler(ArmorListMsg,this,CMsgHandler_selector(CStrengthenItem::processNetMessage));
CSceneManager::sharedSceneManager()->addMsgObserver("updateFilter",this,GameMsghandler_selector(CStrengthenItem::onSetFilter));
}
示例8: onEnter
void CMainCityUI::onEnter()
{
BaseLayer::onEnter();
UserData *user = DataCenter::sharedData()->getUser()->getUserData();
//角色信息相对位置处理
CLayout* headPart = (CLayout*)m_ui->findWidgetById("head_part");
headPart->setPosition(m_ui->convertToNodeSpace(ccp(VLEFT+headPart->getContentSize().width/2, VTOP-headPart->getContentSize().height/2)));
//显示角色名,等级,体力,金币
CLabel *nameLabel = (CLabel*)headPart->getChildByTag(10);
nameLabel->setString(user->getRoleName().c_str());
nameLabel->setColor(RGB_ROLE_COLOR);
CLabel *level = (CLabel*)(headPart->findWidgetById("level"));
level->setString(CCString::createWithFormat("Lv%d",user->getLevel())->getCString());
CProgressBar *progressBar = (CProgressBar*)(headPart->getChildByTag(11));
progressBar->setMaxValue(user->getNextExp());
progressBar->startProgress(user->getExp(),0.3f);
CLabelAtlas *vip_level = (CLabelAtlas*)(headPart->findWidgetById("level_vip"));
vip_level->setString(ToString(user->getVip()));
if (user->getVip()==0)
{
vip_level->setVisible(false);
CLabelAtlas *vip_font = (CLabelAtlas*)(headPart->findWidgetById("vip_font"));
vip_font->setVisible(false);
}
CImageView *headbg = (CImageView *)(headPart->findWidgetById("headbg"));
headbg->setTouchEnabled(true);
headbg->setOnClickListener(this, ccw_click_selector(CMainCityUI::onHeadImgBtn));
CButton *button = nullptr;
int i = 1;
for (; i<=9; ++i)
{
CCNode *lay = dynamic_cast<CCNode*>( m_ui->getChildByTag(i));
button = dynamic_cast<CButton*>(lay->getChildByTag(i));
// button->setEnabled(false);
button->setOnClickListener(this, ccw_click_selector(CMainCityUI::onClickBtn));
button->setSelectedTexture(((CCSprite*)(button->getNormalImage()))->getTexture());
button->getSelectedImage()->setScale(1.1f);
m_btnPos[i] = button->getPosition();
}
CCSprite* head = (CCSprite*)headPart->getChildByTag(15);
if (user->getThumb()>0)
{
CCTexture2D *texture = CCTextureCache::sharedTextureCache()
->addImage(CCString::createWithFormat("headIcon/%d.png", user->getThumb())->getCString());
if (texture)
{
head->setTexture(texture);
}
}
else
{
string fbName = user->getFbId()+".jpg";
string fullName = CCFileUtils::sharedFileUtils()->fullPathForFilename(fbName.c_str());
bool isFileExist = CCFileUtils::sharedFileUtils()->isFileExist(fullName);
if(isFileExist)
{
CCSprite *headBg = (CCSprite *)(headPart->findWidgetById("headbg"));
CCSprite *sp = CCSprite::create(fbName.c_str());
CCSprite* spr = MakeFaceBookHeadToCircle(sp);
spr->setPosition(headBg->getPosition());
headPart->removeChild(head);
spr->setTag(15);
headPart->addChild(spr);
}
else
{
HttpLoadImage::getInstance()->bindUiTarget(this);
CCString *imgUrl = CCString::createWithFormat(FACEBOOKIMG_106,user->getFbId().c_str());
HttpLoadImage::getInstance()->requestUrlImage(imgUrl->getCString(),user->getFbId().c_str());
}
}
CImageView* vip = (CImageView*)headPart->findWidgetById("vip");
vip->setTouchEnabled(true);
vip->setOnClickListener(this,ccw_click_selector(CMainCityUI::onVip));
//添加签到,充值等其他入口
CAccessLayer* pAccess = CAccessLayer::create();
this->addChild(pAccess, 99);
CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_HERO,this,GameMsghandler_selector(CMainCityUI::updateRoleProperty));
CSceneManager::sharedSceneManager()->addMsgObserver(TASK_NOTICE,this,GameMsghandler_selector(CMainCityUI::updateTaskNotice));
CSceneManager::sharedSceneManager()->addMsgObserver(MAIL_NOTICE,this,GameMsghandler_selector(CMainCityUI::updateMailNotice));
CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_FUNCTIONOPEN,this,GameMsghandler_selector(CMainCityUI::updateFuctionOpen));
CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_GAMETIP,this,GameMsghandler_selector(CMainCityUI::updateGameTip));
CSceneManager::sharedSceneManager()->addMsgObserver(SHOW_HEAD,this,GameMsghandler_selector(CMainCityUI::showHead));
CCSprite *red = (CCSprite*)(m_ui->findWidgetById("redPoint"));
CCSprite *mailPoint = (CCSprite*)(m_ui->findWidgetById("mailPoint"));
//.........这里部分代码省略.........