示例#1
0
void UIWidget::setOpacity(int opacity)
{
    RGBAProtocol* rgbap = DYNAMIC_CAST_RGBAProtocol;
    if (rgbap)
    {
        rgbap->setOpacity(opacity);
    }
}
示例#2
0
void FadeTo::update(float time)
{
    RGBAProtocol *pRGBAProtocol = dynamic_cast<RGBAProtocol*>(_target);
    if (pRGBAProtocol)
    {
        pRGBAProtocol->setOpacity((GLubyte)(_fromOpacity + (_toOpacity - _fromOpacity) * time));
    }
    /*_target->setOpacity((GLubyte)(_fromOpacity + (_toOpacity - _fromOpacity) * time));*/
}
示例#3
0
void FadeOut::update(float time)
{
    RGBAProtocol *pRGBAProtocol = dynamic_cast<RGBAProtocol*>(_target);
    if (pRGBAProtocol)
    {
        pRGBAProtocol->setOpacity(GLubyte(255 * (1 - time)));
    }
    /*_target->setOpacity(GLubyte(255 * (1 - time)));*/    
}