cocos2d-x-2.2.6子类随父类透明度变化而变化setCascadeOpacityEnabled(true)

部分代码

    CCLabelAtlas * labelSec =CCLabelAtlas::create("00", "Themes/Number/common_num_yellow_20.png", 20, 30,'0');
    labelSec->setAnchorPoint(ccp(0.5, 0.5));
    labelSec->setPosition(ccp(229,45));
    labelSec->setTag(TAG_LABEL_SECOND);
    pSpriteItem->addChild(labelSec);
    pSpriteItem->setCascadeOpacityEnabled(true);//参数为true,则子类随父类变化而变化

你可能感兴趣的:(cocos2dx效果demo)