CCTintTo&CCTintBy概念
CCTintTo:调整某一CCNode对象的rgb色值到某一值。它的类继承图为:
CCTintBy:调整某一CCNode对象的rgb值。它的类继承图为:
CCTintTo&CCTintBy使用方式
//通过对象的表态方法create创建对象实例;其中 //第一参数为渐变时间,第二个参数为RGB中的R值,第三个参数为RGB中的G值,第四个参数为RGB中的B值 CCActionInterval* action1 = CCTintTo::create(2, 255, 0, 255); CCActionInterval* action2 = CCTintBy::create(2, -127, -255, -127); CCActionInterval* action2Back = action2->reverse(); m_tamara->runAction( action1); m_kathia->runAction( CCSequence::create( action2, action2Back, NULL));
效果图如下: