How to create ad-hoc tweens sequence without recursion in KineticJS?

放肆的年华 提交于 2019-12-25 02:46:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!