CCMenuItemImage 让按钮被点击时显示另一张图片(cocos2d-x基础)

    


// 利用Image建立按钮

   CCMenuItemImage* item01=CCMenuItemImage::create("starMenuButton01.png", "starMenuButton02.png");

   item01->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y-100));

    // create menu, it's an autorelease object

    

    

    CCMenu* pMenu = CCMenu::create(item01, NULL);

    pMenu->setPosition(CCPointZero);

    this->addChild(pMenu, 1);

你可能感兴趣的:(按钮,cocos2d-x)