The problem with the code below is that between two animations there is a pause of about half a second. I'd like the node to spin continuously.
RotateTransition rt = new RotateTransition(Duration.seconds(2), syncNode);
rt.setFromAngle(0);
rt.setToAngle(360);
rt.setCycleCount(Animation.INDEFINITE);
rt.play();
The Interpolator
used by default makes the rotation "speed up" at the start and "slow down" at the end, which is why you get the behaviour you described.
Use the LINEAR
interpolator instead to get a animation with constant speed:
rt.setInterpolator(Interpolator.LINEAR);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With