TintTo和TintBy

时间:2021-05-19 09:04:58
//创建标签
var helloLabel = cc.LabelTTF.create("Hello World", "Arial", );
//设置位置
helloLabel.setPosition(cc.p(,));
//添加到layer
this.addChild(helloLabel, ); //改变颜色,不可reverse var hurtColor = cc.TintTo.create(2.5,-,,); //移动并同时改变颜色 helloLabel.runAction(cc.Spawn.create(cc.MoveBy.create(2.5, cc.p(0, 300 - 40)),
hurtColor)); //改变颜色并回滚颜色
var action2 = cc.TintBy.create(, -, , );
var action2Back = action2.reverse();
helloLabel.runAction(cc.Sequence.create(action2, action2Back));