Change direction of javafx RotateTransition to dir

2019-03-06 08:28发布

in my javafx application, i have an imageView for which I have created an Rotate trasition, everything works fine , but the rotation direction is in counterclockwise of watch, i want to make it in opposite direction .

this is My code :

RotateTransition rt = new RotateTransition(Duration.millis(3000), myImageView);
rt.setByAngle(360);
rt.setCycleCount(1);
rt.setAutoReverse(false);
rt.play()

;

1条回答
ゆ 、 Hurt°
2楼-- · 2019-03-06 08:57

It seems to be undocumented, but setting a negative angle results in a counter-clockwise rotation:

rt.setByAngle(-360);
查看更多
登录 后发表回答