Thibaut Lamanthe Thibaut Lamanthe - 28 days ago 16
Javascript Question

KineticJS easing

I created a shape in KineticJS and I animate it with tween.

var tween = new Kinetic.Tween({
node: rect,
duration: 1,
easing: Kinetic.Easings.BackEaseOut,
y: 100
});


During reverse is it possible to change the easing?

Currently I have do that : JSFiddle

Thanks a lot for your help.

Answer

This seems to work... But this is not really core func...

stage.on('mouseover', function() {
    tween.tween.func = Kinetic.Easings.BounceEaseOut;
    tween.play();
});

stage.on('mouseout', function() {
    tween.tween.func = Kinetic.Easings.BounceEaseIn;
    tween.reverse();
});
Comments