Javascript 如何根据时间降低qml中的转速?
我需要在qml中创建类似命运轮的东西。我知道如何使用旋转动画,但我不能根据时间降低旋转速度。这个动画最终应该在没有用户交互的情况下停止。在这种情况下我应该使用什么?@Frank Osterfeld已经说过了,所以我在这里举了一个小例子:Javascript 如何根据时间降低qml中的转速?,javascript,qt,qml,Javascript,Qt,Qml,我需要在qml中创建类似命运轮的东西。我知道如何使用旋转动画,但我不能根据时间降低旋转速度。这个动画最终应该在没有用户交互的情况下停止。在这种情况下我应该使用什么?@Frank Osterfeld已经说过了,所以我在这里举了一个小例子: Rectangle { anchors.centerIn: parent radius: 100 clip: true width: 200 height: 200 color: "yellow" Text
Rectangle {
anchors.centerIn: parent
radius: 100
clip: true
width: 200
height: 200
color: "yellow"
Text {
text: "+"
font.pixelSize: 200
anchors.centerIn: parent
}
PropertyAnimation on rotation {
from: 0
to: 3600
duration: 10000
running: true
easing.type: Easing.InOutQuint
}
}
@弗兰克·奥斯特菲尔德(Frank Osterfeld)已经说过了,所以我只举了一个小例子:
Rectangle {
anchors.centerIn: parent
radius: 100
clip: true
width: 200
height: 200
color: "yellow"
Text {
text: "+"
font.pixelSize: 200
anchors.centerIn: parent
}
PropertyAnimation on rotation {
from: 0
to: 3600
duration: 10000
running: true
easing.type: Easing.InOutQuint
}
}
使用计时器来改变旋转。你能提供一些例子吗?你可以使用自定义缓和曲线。我已经尝试过了。也许我做错了什么。使用计时器来改变旋转。你能提供一些例子吗?你可以使用自定义缓和曲线。我已经尝试过了。也许我做错了什么。