1. 创建
var to1 = cc.ProgressTo.create(2, 100);
var to2 = cc.ProgressTo.create(2, 100);
var left = cc.ProgressTimer.create(cc.Sprite.create(s_pathSister1));
left.type = cc.PROGRESS_TIMER_TYPE_RADIAL;
this.addChild(left);
left.x = 200;
left.y = winSize.height / 2;
left.runAction(cc.RepeatForever.create(to1));
var right = cc.ProgressTimer.create(cc.Sprite.create(s_pathBlock));
right.type = cc.PROGRESS_TIMER_TYPE_RADIAL;
right.setReverseDirection(true);
this.addChild(right);
right.x = winSize.width - 200;
right.y = winSize.height / 2;
right.runAction(cc.RepeatForever.create(to2));
2.属性
var left = cc.ProgressTimer.create(cc.Sprite.create(s_pathSister1));
left.type = cc.PROGRESS_TIMER_TYPE_BAR;
// Setup for a bar starting from the left since the midpoint is 0 for the x
left.midPoint = cc.p(0, 0);
// Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change
left.barChangeRate = cc.p(1, 0);