将javafx RotateTransition的方向更改为顺时针方向 [英] Change direction of javafx RotateTransition to direction of clockwise

查看:309
本文介绍了将javafx RotateTransition的方向更改为顺时针方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的javafx应用程序中,我有一个imageView,我已经创建了一个旋转传输,一切正常,但是旋转方向是逆时针方向,我想让它朝相反方向。

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 .

这是我的代码:

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

;

推荐答案

它似乎没有记录,但设置负角度会导致逆时针旋转:

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

rt.setByAngle(-360);

这篇关于将javafx RotateTransition的方向更改为顺时针方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆