void UIWidget::setOpacity(int opacity) { RGBAProtocol* rgbap = DYNAMIC_CAST_RGBAProtocol; if (rgbap) { rgbap->setOpacity(opacity); } }
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));*/ }
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)));*/ }