Change direction of javafx RotateTransition to direction of clockwise

时间秒杀一切 提交于 2019-12-02 18:17:18

问题


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:


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

rt.setByAngle(-360);


来源:https://stackoverflow.com/questions/44094481/change-direction-of-javafx-rotatetransition-to-direction-of-clockwise

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