CCControlButton编程时,为什么CCControlStateSelected的效果不显现?
先谢谢大家的释疑。
严格按照cocos2dx关于CCControlButton的教程做的,但还是不显现CCControlStateSelected的效果。
贴出代码,大家看一下是哪里的问题。
std::string start_game = START_GAME;
G2UTool::GBKToUTF8(start_game);
CCLabelTTF* startGameTTF = CCLabelTTF::create(start_game.c_str(), FONT_MENU, Btn_FontSize);
startGameTTF->setColor(ccc3(240,90,60));
CCControlButton* startGameBtn = CCControlButton::create(startGameTTF, btnNormal4);
startGameBtn->setBackgroundSpriteForState(btnPress4, CCControlStateSelected);
startGameBtn->setPosition(ccp(visibleSize.width - 20, 280));
startGameBtn->setAnchorPoint(ccp(1,0));
startGameBtn->setPreferredSize(CCSize(Btn_Width, Btn_Height));
startGameBtn->addTargetWithActionForControlEvents(this, cccontrol_selector(MenuScene::menuTouchDown), CCControlEventTouchUpInside);
startGameBtn->setTag(Btn_Start_Game_TAG);
this->addChild(startGameBtn);