@wuxiaomo wrote:
I have an animation then want to dynamic control its speed with action speed.
But it is very strange that whatever i add or plus its speed, the animation always speed up.here is the code:
var animationFrames = []; for(var i=1;i!=8;i++){ var path = typeName + i +'.png'; var frame = cc.spriteFrameCache.getSpriteFrame(path); animationFrames.push(frame); } var animation = new cc.Animation(animationFrames,intervalTime); var runningAction = new cc.animate(animation).repeatForever(); runningAction.retain();
here is the speedup function:
adjustRunningSpeed:function(x){ var speedx = this.runningAction.getSpeed(); var finalSpeed = speedx + x; this.runningAction.setSpeed(finalSpeed); },
Posts: 1
Participants: 1