我的代码:
CCMenuItem *soundItem = CCMenuItemImage::create(
"menu/and_sound.png",
"menu/and_sound.png",
this,
NULL );
CCMenuItem *soundOnItem = CCMenuItemImage::create(
"menu/and_soundon.png",
"menu/and_soundon.png",
this,
NULL );
CCMenuItemToggle* soundMenu = CCMenuItemToggle::createWithTarget(this,NULL,soundItem,soundOnItem,NULL);
soundMenu->setPosition(ccp(550,66));
this->addChild(soundMenu,1);
按钮正常显示,但当我按下它时不会将状态和图像更改为选定状态。