将dynamicjs从4.0.5升级到4.5.1之后,我得到了

Uncaught TypeError: Object #<Object> has no method 'transitionTo'

以下代码适用于以前的版本:

gameLayer.transitionTo({
        duration: '0.5',
        opacity: 1,
        callback: function() {
            intervalId = setInterval(reDraw, 33);
            isInteractive = true;

        }
    });


transitionTo4.5.1的替代功能是什么

更新

我在Github上打开了issue,根据the guy transitionTo已被删除,并由Tween代替

问候,

最佳答案

您可以使用onFinish属性,如下所示:

 var tween = new Kinetic.Tween({
    node: rect,
    duration: 1,
    x: 400,
    y: 30,
    rotation: Math.PI * 2,
    opacity: 1,
    strokeWidth: 6,
    scaleX: 1.5,
    onFinish: function() {console.log('onFinish');}
  });

09-16 02:44