问题
is it possible to create tweens sequence in KineticJS according to data saved in array without recursion?
This is my current solution including recursion:
function tweenFunc( image )
{
setGlobalCoordinates();
tween = new Kinetic.Tween({
node: image,
duration: 1,
x: x,
y: y,
rotation: rot,
onFinish: function(){
if ( counter++ < arr.length )
{
tweenFunc( image );
}
}
});
tween.play();
}
I would like to have solution which creates tweens before first animation and following tweens start from final position of predecessor. This project includes animation of 4 images in the same time for many position sequence.
来源:https://stackoverflow.com/questions/22584824/how-to-create-ad-hoc-tweens-sequence-without-recursion-in-kineticjs