示例#1
0
void UIWidget::setColor(const Color3B &color)
{
    RGBAProtocol* rgbap = DYNAMIC_CAST_RGBAProtocol;
    if (rgbap)
    {
        rgbap->setColor(color);
    }
}
示例#2
0
void TintBy::update(float time)
{
    RGBAProtocol *pRGBAProtocol = dynamic_cast<RGBAProtocol*>(_target);
    if (pRGBAProtocol)
    {
        pRGBAProtocol->setColor(Color3B((GLubyte)(_fromR + _deltaR * time),
            (GLubyte)(_fromG + _deltaG * time),
            (GLubyte)(_fromB + _deltaB * time)));
    }    
}
示例#3
0
void TintTo::update(float time)
{
    RGBAProtocol *pRGBAProtocol = dynamic_cast<RGBAProtocol*>(_target);
    if (pRGBAProtocol)
    {
        pRGBAProtocol->setColor(Color3B(GLubyte(_from.r + (_to.r - _from.r) * time), 
            (GLubyte)(_from.g + (_to.g - _from.g) * time),
            (GLubyte)(_from.b + (_to.b - _from.b) * time)));
    }    
}