bool AheadChapter::init() { if (!CCLayerRGBA::init()) return false; _aUILayer = UILayer::create(); this->addChild(_aUILayer); _ahead_root = static_cast<Layout *>(CCUIHELPER->createWidgetFromJsonFile(CG_GamePathes[kAheadChapter].c_str())); _aUILayer->addWidget(_ahead_root); UIButton *startButt = static_cast<UIButton *>(_ahead_root->getChildByName("start_butt")); startButt->setTouchEnable(true); startButt->addTouchEventListener(this, toucheventselector(AheadChapter::startGame)); UIButton *resetButt = static_cast<UIButton *>(_ahead_root->getChildByName("reset_butt")); resetButt->setTouchEnable(true); resetButt->addTouchEventListener(this, toucheventselector(AheadChapter::reSetGame)); UIButton *settingButt = static_cast<UIButton *>(_ahead_root->getChildByName("setting_butt")); settingButt->setTouchEnable(true); settingButt->addTouchEventListener(this, toucheventselector(AheadChapter::settingGame)); UIImageView *map_image = static_cast<UIImageView *>(_ahead_root->getChildByName("gMap_image")); map_image->setTouchEnable(true); map_image->addTouchEventListener(this, toucheventselector(AheadChapter::enterAcountManager)); return true; }
void GameLayer_Menu::setNoLogin(bool visiable) { UIPanel* dayLoginPanel = dynamic_cast<UIPanel*>(gameMenu->getWidgetByName("MenuBtn")); dayLoginPanel->setVisible(visiable); UIButton* taskBtn = dynamic_cast<UIButton*>(gameMenu->getWidgetByName("SysInfoBtn")); taskBtn->setTouchEnable(visiable); UIButton* emailBtn = dynamic_cast<UIButton*>(gameMenu->getWidgetByName("EmailBtn")); emailBtn->setTouchEnable(visiable); UIButton* addFriendBtn = dynamic_cast<UIButton*>(gameMenu->getWidgetByName("AddFriendBtn")); addFriendBtn->setTouchEnable(visiable); UIButton* rankBtn = dynamic_cast<UIButton*>(gameMenu->getWidgetByName("RankBtn")); rankBtn->setVisible(visiable); rankBtn->setTouchEnable(visiable); }
void GameLayer::initAnswerLayer(std::vector<std::string> &StrVector) { CCArray *answerChildren = _answerLayer->getChildren(); _canAnsImageSize = static_cast<UIButton *>(answerChildren->objectAtIndex(0))->getContentSize(); CCObject *obj_butt; int countPerRow = 8; int row = 0,col = 0; int currCount = 0; CCARRAY_FOREACH(answerChildren, obj_butt) { row = currCount / countPerRow; col = currCount % countPerRow; UIButton *anButt = (UIButton *)(obj_butt); anButt->setTouchEnable(true); anButt->addTouchEventListener(this,toucheventselector(GameLayer::answerButt)); CCPoint buttPoint = CCPointMake(CG_FISTANBUTT_POINT.x + (CG_ANSWER_BUTT_SPACE_SIZE.width)* col, CG_FISTANBUTT_POINT.y + (CG_ANSWER_BUTT_SPACE_SIZE.height) * row); anButt->setPosition(buttPoint); std::string butt_titlt_str = StrVector.at(currCount); if (!CGHelper::isChineseChar(butt_titlt_str.c_str())) { anButt->setTitleFontSize(20); } anButt->setText(butt_titlt_str.c_str()); currCount++; }
void PlayScene::TakeOff() { UIButton* btn = NULL; btn = (UIButton *)ui_layer_->getWidgetByName(btn_name[sub_stage_id_]); if (btn) { btn->setTouchEnable(true); btn->addTouchEventListener(this, toucheventselector(PlayScene::onBtnClothes)); btn->addMoveEvent(this, coco_moveselector(PlayScene::onBtnMoveClothes)); TakeOffAction(btn); } CCLOG("%s error sub_stage_id_:%d\n", __FUNCTION__, sub_stage_id_); return; }
void PlayScene::onEnter() { CCScene::onEnter(); CCLOG("%s", __FUNCTION__); // load ui ui_layer_ = UILayer::create(); ui_layer_text_ = UILayer::create(); char path[1024]; snprintf(path, 1024, "MainScene/GirlScene%d.json", stageid_); Layout *layout = dynamic_cast<Layout*>(CCUIHELPER->createWidgetFromJsonFile(path)); ui_layer_->addWidget(layout); card_mgr_.CreateLayer(this); this->addChild(ui_layer_, 0, 100); this->addChild(card_mgr_.card_layer(), 1, 101); this->addChild(ui_layer_text_, 2, 100); card_mgr_.Init(stageid_); UIButton *btn = (UIButton *)ui_layer_->getWidgetByName("BtnBack"); if (btn) { btn->addTouchEventListener(this, toucheventselector(PlayScene::onBtnBack)); btn->setPressedActionEnabled(true); } UIPanel *panel = (UIPanel *)ui_layer_->getWidgetByName("PanelSecond"); if(panel == NULL) { return; } panel->setVisible(false); panel->setTouchEnable(false); btn = (UIButton *)ui_layer_->getWidgetByName("BtnStartPlay"); if (btn) { btn->addTouchEventListener(this, toucheventselector(PlayScene::onBtnStartPlay)); CCScaleTo* scale1 = CCScaleTo::create( 1.0f, 1.2f); CCScaleTo* scale2 = CCScaleTo::create( 1.0f, 0.8f); CCSequence* scale = CCSequence::createWithTwoActions(scale1, scale2); btn->getVirtualRenderer()->runAction(CCRepeatForever::create(scale)); } btn = (UIButton *)ui_layer_->getWidgetByName("BtnShirt"); if (btn) { btn->setTouchEnable(false); } card_mgr_.SetEnable(false); be_back_ = false; property_state_ = -1; }
bool GameLayer_GoldMarket::init() { if (!CCLayer::init()) { return false; } //系统设置界面. goldMarket = UILayer::create(); auto layout = dynamic_cast<Layout*>(GUIReader::shareReader()->widgetFromJsonFile("./CocoStudioResources/GoldMarket.json")); goldMarket->addWidget(layout); // sysSet->setVisible(true); this->addChild(goldMarket, 0, 101); UIPanel* panel = dynamic_cast<UIPanel*>(goldMarket->getWidgetByName("Panel")); panel->setBackGroundColor(ccBLACK); panel->setBackGroundColorOpacity(150); //关闭按钮 UIButton* closeBtn = dynamic_cast<UIButton*>(goldMarket->getWidgetByName("CloseBtn")); closeBtn->setTouchEnable(true); closeBtn->addReleaseEvent(this, coco_releaseselector(GameLayer_GoldMarket::closeBtnCallback)); closeBtn->setPressedActionEnabled(true); //购买按钮. UIButton* buyBtn_0 = dynamic_cast<UIButton*>(goldMarket->getWidgetByName("BuyBtn_0")); buyBtn_0->setTag(Buy_0); buyBtn_0->setPressedActionEnabled(true); buyBtn_0->addReleaseEvent(this, coco_releaseselector(GameLayer_GoldMarket::buyBtnCallback)); UIButton* buyBtn_1 = dynamic_cast<UIButton*>(goldMarket->getWidgetByName("BuyBtn_1")); buyBtn_1->setTag(Buy_1); buyBtn_1->setPressedActionEnabled(true); buyBtn_1->addReleaseEvent(this, coco_releaseselector(GameLayer_GoldMarket::buyBtnCallback)); UIButton* buyBtn_2 = dynamic_cast<UIButton*>(goldMarket->getWidgetByName("BuyBtn_2")); buyBtn_2->setTag(Buy_2); buyBtn_2->setPressedActionEnabled(true); buyBtn_2->addReleaseEvent(this, coco_releaseselector(GameLayer_GoldMarket::buyBtnCallback)); UIButton* buyBtn_3 = dynamic_cast<UIButton*>(goldMarket->getWidgetByName("BuyBtn_3")); buyBtn_3->setTag(Buy_3); buyBtn_3->setPressedActionEnabled(true); buyBtn_3->addReleaseEvent(this, coco_releaseselector(GameLayer_GoldMarket::buyBtnCallback)); //UIButton* buyBtn_4 = dynamic_cast<UIButton*>(goldMarket->getWidgetByName("BuyBtn_4")); //buyBtn_4->setTag(Buy_4); //buyBtn_4->setPressedActionEnabled(true); //buyBtn_4->addReleaseEvent(this, coco_releaseselector(GameLayer_GoldMarket::buyBtnCallback)); this->setValue(); //添加兑换按钮 this->setVisible(true); return true; }
void GeneralGroupLogic::GeneralBottonClicked( CCObject* pSender ) { UIButton* pButton = DynamicCast<UIButton*>(pSender); int widgetTag = pButton->getWidgetTag(); EGeneralType type = m_generalData[widgetTag]; GeneralFactory::Get().CreateGeneral(this, type, ccp(240,200)); pButton->setTouchEnable(false); pButton->setPressState(WidgetStateDisabled); if (m_buttonCdMap.find(pButton) == m_buttonCdMap.end()) m_buttonCdMap.insert(std::pair<UIButton*, float>(pButton, 0.0f)); }
bool GameLayerPkBar::init() { if (!CCLayer::init()) { return false; } ul = UILayer::create(); auto myLayout = dynamic_cast<Layout*>(GUIReader::shareReader()->widgetFromJsonFile(CStringUtil::convertToUIResPath("PkBar.json").c_str())); ul->addWidget(myLayout); this->addChild(ul, 0, 100); UIButton* btn = dynamic_cast<UIButton*>(ul->getWidgetByName("Sure")); btn->setPressedActionEnabled(true); btn->setTouchEnable(true); btn->addReleaseEvent(this, coco_releaseselector(GameLayerPkBar::sureBtnCallback)); return true; }
void GeneralGroupLogic::onEnter() { CCNode::onEnter(); // Create general buttons in game. for (UINT i = 0; i < m_generalData.size(); ++i) { UIButton* pButton = UIButton::create(); pButton->setWidgetTag(static_cast<int>(i)); pButton->setPosition(ccp(VisibleRect::right().x - 10, 30 * (1 + i) + 50)); pButton->setTouchEnable(true); // Set relationship between these picture with generalType. EGeneralType type = m_generalData[i]; pButton->setTextures(NormalPng[type], SelectedPng[type], DisablePng[type]); pButton->addReleaseEvent(this, coco_releaseselector(GeneralGroupLogic::GeneralBottonClicked)); pButton->addPushDownEvent(this, coco_releaseselector(GeneralGroupLogic::GeneralBottonPushDown)); pButton->setScale(0.5f); UiManager::Singleton().AddChildWidget(pButton); } }
bool UIPanelTest_Color::init() { if (UIScene::init()) { CCSize screenSize = CCDirector::sharedDirector()->getWinSize(); // Add the alert UILabel *alert = UILabel::create(); alert->setText("Panel color render"); alert->setFontName("Marker Felt"); alert->setFontSize(30); alert->setColor(ccc3(159, 168, 176)); alert->setPosition(ccp(screenSize.width / 2.0f, screenSize.height / 2.0f - alert->getRect().size.height * 2.925)); m_pUiLayer->addWidget(alert); UIPanel *background = dynamic_cast<UIPanel*>(m_pUiLayer->getWidgetByName("background_Panel")); // Create the panel with color render UIPanel* panel = UIPanel::create(); panel->setBackGroundColorType(PANEL_COLOR_SOLID); panel->setBackGroundColor(ccc3(128, 128, 128)); panel->setClippingEnable(true); panel->setSize(CCSizeMake(280, 150)); CCSize backgroundSize = background->getContentSize(); panel->setPosition(ccp((screenSize.width - backgroundSize.width) / 2 + (backgroundSize.width - panel->getRect().size.width) / 2, (screenSize.height - backgroundSize.height) / 2 + (backgroundSize.height - panel->getRect().size.height) / 2)); m_pUiLayer->addWidget(panel); UIButton* button = UIButton::create(); button->setTouchEnable(true); button->setTextures("cocosgui/animationbuttonnormal.png", "cocosgui/animationbuttonpressed.png", ""); button->setPosition(ccp(button->getRect().size.width / 2, panel->getRect().size.height - button->getRect().size.height / 2)); panel->addChild(button); UITextButton* textButton = UITextButton::create(); textButton->setTouchEnable(true); textButton->setTextures("cocosgui/backtotopnormal.png", "cocosgui/backtotoppressed.png", ""); textButton->setText("Text Button"); textButton->setPosition(ccp(panel->getRect().size.width / 2, panel->getRect().size.height / 2)); panel->addChild(textButton); UIZoomButton* zoomButton = UIZoomButton::create(); zoomButton->setTouchEnable(true); zoomButton->setTextures("cocosgui/button.png", "cocosgui/buttonHighlighted.png", "cocosgui/button.png"); zoomButton->setTitle("ControlButton", "ControlButton", "ControlButton"); zoomButton->setNormalFontSize(16); zoomButton->setNormalFontName("Marker Felt"); zoomButton->setPressedFontSize(16); zoomButton->setPressedFontName("Marker Felt"); zoomButton->setDisabledFontSize(16); zoomButton->setDisabledFontName("Marker Felt"); zoomButton->setPreferredSize(CCSizeMake(100, zoomButton->getContentSize().height * 2.0f)); zoomButton->setPosition(ccp(panel->getRect().size.width - zoomButton->getRect().size.width / 2, zoomButton->getRect().size.height / 2)); panel->addChild(zoomButton); return true; } return false; }
void ZhuangBeiListLayer::setData(HeroType hero,int type,ZhuangBeiType zhuangtype) { UILayer*m_pUiLayer=UILayer::create(); addChild(m_pUiLayer,0); CCSize winSize =CCDirector::sharedDirector()->getWinSize(); UIImageView * imagebg=UIImageView::create(); setTouchEnabled(true); imagebg->setTexture("herobg.png"); imagebg->setPosition(ccp(winSize.width/2, winSize.height/2)); m_pUiLayer->addWidget(imagebg); UIScrollView*scrollView = UIScrollView::create(); scrollView->setTouchEnable(true); scrollView->setBounceEnabled(true); scrollView->setSize(CCSize(winSize.width,600)); scrollView->setPosition(ccp(0,winSize.height/2-360)); m_pUiLayer->addWidget(scrollView); vector<ZhuangBeiType> zhuangBeis=GameData::shareGameData()->getZhuangbei(); int j=0; for(int i=0;i<zhuangBeis.size();i++) { ZhuangBeiType zhuang=zhuangBeis[i]; int t=(type+3)*100; printf("zhuangtype==%d,%d,%d",zhuang.type,t,m_type); if((zhuang.type>=t&&zhuang.type<(t+100))||type==-1) { j++; UIImageView* imageView = UIImageView::create(); imageView->setTexture("cellbg.png"); int imageHeight=imageView->getRect().size.height; float innerWidth = scrollView->getRect().size.width; float innerHeight = scrollView->getRect().size.height +imageHeight*zhuangBeis.size(); scrollView->setInnerContainerSize(CCSizeMake(innerWidth, innerHeight)); imageView->setPosition(ccp(innerWidth / 2,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/2)); scrollView->addChild(imageView); UIImageView* imagebg= UIImageView::create(); imagebg->setTexture("addbutton.png"); imagebg->setPosition(ccp(120,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/2)); scrollView->addChild(imagebg); UIImageView* imageHead = UIImageView::create(); imageHead->setTexture(zhuang.textureName.c_str()); imageHead->setPosition(ccp(120,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/2)); scrollView->addChild(imageHead); UILabel *label=UILabel::create(); char strlevel[32]; sprintf(strlevel,"Lv:%d",zhuang.level); label->setFontSize(24); label->setText(strlevel); label->setColor(ccBLUE); label->setPosition(ccp(winSize.width/2-100,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight-60)); scrollView->addChild(label); UILabel *namelabel=UILabel::create(); namelabel->setFontSize(24); namelabel->setText(zhuang.name.c_str()); namelabel->setColor(ccBLUE); namelabel->setPosition(ccp(winSize.width/2,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight-60)); scrollView->addChild(namelabel); if(zhuang.hp>0) { UIImageView* imageattack = UIImageView::create(); imageattack->setTexture("heart.png"); imageattack->setPosition(ccp(winSize.width/2-100,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(imageattack); UILabel *label=UILabel::create(); label->setPosition(ccp(winSize.width/2-40,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(label); char str[32]; int hp=zhuang.hp+(40+10*zhuang.star)*zhuang.level; sprintf(str,"%d",hp); label->setFontSize(24); label->setColor(ccBLACK); label->setText(str); } if(zhuang.ap>0) { UIImageView* imageattack = UIImageView::create(); imageattack->setTexture("swordicon.png"); imageattack->setPosition(ccp(winSize.width/2+40,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(imageattack); UILabel *label=UILabel::create(); label->setPosition(ccp(winSize.width/2+100,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(label); char str[32]; int ap=zhuang.ap+(10+2*zhuang.star)*zhuang.level; sprintf(str,"%d",ap); label->setColor(ccBLACK); label->setFontSize(24); label->setText(str); } if(zhuang.defender>0) { UIImageView* imageattack = UIImageView::create(); imageattack->setTexture("fang.png"); imageattack->setPosition(ccp(winSize.width/2-100,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(imageattack); UILabel *label=UILabel::create(); label->setPosition(ccp(winSize.width/2-40,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(label); char str[32]; int defender=zhuang.defender+(6+1*zhuang.star)*zhuang.level; sprintf(str,"%d",defender); label->setColor(ccBLACK); label->setFontSize(24); label->setText(str); } if(zhuang.magicdefender>0) { UIImageView* imageattack = UIImageView::create(); imageattack->setTexture("mofang.png"); imageattack->setPosition(ccp(winSize.width/2+40,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(imageattack); UILabel *label=UILabel::create(); label->setPosition(ccp(winSize.width/2+100,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(label); char str[32]; int magicdefender=zhuang.magicdefender+(6+1*zhuang.star)*zhuang.level; sprintf(str,"%d",magicdefender); label->setFontSize(24); label->setColor(ccBLACK); label->setText(str); } for(int i=0;i<zhuang.star;i++) { UIImageView* imageattack = UIImageView::create(); imageattack->setTexture("star.png"); imageattack->setPosition(ccp(winSize.width/2+i*20+100,scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight-60)); scrollView->addChild(imageattack); } UIButton* button = UIButton::create(); button->setTouchEnable(true); button->setTag(zhuang.index); //string texturename=zhuang.textureName; if(type==-1) { button->loadTextures("heroup1.png", "heroup2.png", ""); button->addReleaseEvent(this, coco_releaseselector(ZhuangBeiListLayer::Shengji)); } else { button->loadTextures("zhuangbei1.png", "zhuangbei2.png", ""); button->addReleaseEvent(this, coco_releaseselector(ZhuangBeiListLayer::menuPauseCallback)); } button->setPosition(ccp(winSize.width-120, scrollView->getInnerContainerSize().height-imageHeight*j+imageHeight/3)); scrollView->addChild(button); } } UIButton * btn= UIButton::create(); btn->setTouchEnable(true); btn->addReleaseEvent(this, coco_releaseselector(ZhuangBeiListLayer::close)); btn->setTextures("close1.png","close2.png","close2.png"); btn->setPosition(ccp(winSize.width-60, winSize.height/2+300)); m_pUiLayer->addWidget(btn); }
bool JiangLiLayer::init() { if(!CCLayer::init()){ return false; } int mlevel=GameData::shareGameData()->mlevel; CCSize winSize =CCDirector::sharedDirector()->getWinSize(); UILayer *m_pUiLayer=UILayer::create(); addChild(m_pUiLayer,1); UIImageView* imagehead= UIImageView::create(); imagehead->setTexture("menubg.png"); imagehead->setPosition(ccp(winSize.width/2,winSize.height/2)); m_pUiLayer->addWidget(imagehead); UIScrollView* scrollView = UIScrollView::create(); scrollView->setTouchEnable(true); scrollView->setBounceEnabled(true); scrollView->setSize(CCSize(winSize.width,600)); scrollView->setPosition(ccp(0,winSize.height/2-360)); m_pUiLayer->addWidget(scrollView); UIButton * btn= UIButton::create(); btn->setTouchEnable(true); btn->addReleaseEvent(this, coco_releaseselector(JiangLiLayer::close)); btn->setTextures("close1.png","close2.png","close2.png"); btn->setPosition(ccp(winSize.width-60, winSize.height/2+300)); m_pUiLayer->addWidget(btn); mlevel=GameData::shareGameData()->mlevel; bool support=CCUserDefault::sharedUserDefault()->getBoolForKey("support",false); bool level[9]; for(int i=0;i<9;i++) { char str[64]; sprintf(str,"level%d",i); level[i]=CCUserDefault::sharedUserDefault()->getBoolForKey(str,false); } CCUserDefault::sharedUserDefault()->flush(); int number=10; if(support) number=9; for(int i=0;i<number;i++) { UIImageView* imageView = UIImageView::create(); imageView->setTexture("cellbg.png"); float innerWidth = scrollView->getRect().size.width; float innerHeight =(imageView->getRect().size.height)*number; scrollView->setInnerContainerSize(CCSizeMake(innerWidth, innerHeight)); int imageHeight=imageView->getRect().size.height; imageView->setPosition(ccp(winSize.width/2,scrollView->getInnerContainerSize().height-imageHeight*i-imageHeight/2)); scrollView->addChild(imageView); UIImageView* imagehead= UIImageView::create(); imagehead->setTexture("yuanbao.png"); imagehead->setPosition(ccp(winSize.width/2-140,scrollView->getInnerContainerSize().height-imageHeight*i-imageHeight/2)); scrollView->addChild(imagehead); char str[64]; if(i<9) { sprintf(str,"%d",(i+1)*20000); } else { sprintf(str,"%d",50000); } UILabel *moneyLabel=UILabel::create(); moneyLabel->setText(str); moneyLabel->setColor(ccBLACK); moneyLabel->setFontSize(32); moneyLabel->setPosition(ccp(winSize.width/2+100,scrollView->getInnerContainerSize().height-imageHeight*i-imageHeight/2)); scrollView->addChild(moneyLabel); if(i<9) { sprintf(str,"%d级\n礼包",10*(i+1)); } else { sprintf(str,"5星评论"); } UILabel *label=UILabel::create(); label->setFontSize(32); label->setText(str); label->setColor(ccBLUE); scrollView->addChild(label); label->setPosition(ccp(100,scrollView->getInnerContainerSize().height-imageHeight*i-imageHeight/2)); // UIImageView* imagecoin= UIImageView::create(); // imagecoin->setTexture("dollar.png"); // imagecoin->setPosition(ccp(350,scrollView->getInnerContainerSize().height-imageHeight*i-imageHeight/2)); // scrollView->addChild(imagecoin); if(i<9) { sprintf(str,"%d",(i+1)*100); } else { sprintf(str,"%d",500); } UILabel *coinLabel=UILabel::create(); coinLabel->setText(str); coinLabel->setFontSize(32); coinLabel->setColor(ccBLACK); coinLabel->setPosition(ccp(winSize.width/2-70,scrollView->getInnerContainerSize().height-imageHeight*i-imageHeight/2)); scrollView->addChild(coinLabel); UIButton* button = UIButton::create(); // if(level[i])//已经领取 // { // button->setTouchEnable(false); // button->loadTextures("fight1.png", "fight1.png", ""); // button->addReleaseEvent(this, coco_releaseselector(JiangLiLayer::menuCallback)); // } if(mlevel>=10*(i+1))//等级满足 { button->setTouchEnable(true); button->loadTextures("getmoney2.png", "getmoney1.png", ""); button->addReleaseEvent(this, coco_releaseselector(JiangLiLayer::menuPauseCallback)); } else//等级不满足 { button->setTouchEnable(false); button->loadTextures("getmoney1.png", "getmoney2.png", ""); button->addReleaseEvent(this, coco_releaseselector(JiangLiLayer::menuCallback)); } if(i==9)//等级满足 { button->setTouchEnable(true); button->loadTextures("getmoney2.png", "getmoney1.png", ""); button->addReleaseEvent(this, coco_releaseselector(JiangLiLayer::menuPauseCallback)); } button->setPosition(ccp(winSize.width-100, scrollView->getInnerContainerSize().height-imageHeight*i-imageHeight/2)); button->setTag(i); scrollView->addChild(button); } return true; }