Exemplo n.º 1
0
void CAIndicator::setHide(bool var)
{
    CAScale9ImageView* indicator = dynamic_cast<CAScale9ImageView*>(m_pIndicator);
    
    do
    {
        if (var == false)
        {
            CC_BREAK_IF(indicator->getOpacity() == 255);
            
            this->stopActionByTag(0xfff);
            this->setOpacity(255);
        }
        else
        {
            CC_BREAK_IF(indicator->getActionByTag(0xfff));
            
            CC_BREAK_IF(indicator->getOpacity() < 255);
            
            CCDelayTime* delayTime = CCDelayTime::create(0.2f);
            CCFadeOut* fadeOut = CCFadeOut::create(0.3f);
            CCEaseSineOut* easeSineOut = CCEaseSineOut::create(fadeOut);
            CCSequence* actions = CCSequence::create(delayTime, easeSineOut, NULL);
            actions->setTag(0xfff);
            this->runAction(actions);
        }
    }
    while (0);
}