-
Notifications
You must be signed in to change notification settings - Fork 2
/
SeqenceAnimation.qml
54 lines (47 loc) · 1.48 KB
/
SeqenceAnimation.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
Rectangle {
width: 240
height: 320
color: "black"
Rectangle {
id:ball
width: parent.width/4; height: width; radius: width;
x:0; y:0;
color: "magenta"
smooth: true
SequentialAnimation {
// ParallelAnimation {
id: bounce
SmoothedAnimation{
property: "x"; target: ball; velocity: 200;
to:240-ball.width; //easing.type: Easing.OutBounce;
reversingMode: SmoothedAnimation.Immediate;
}
SmoothedAnimation {
property: "y"; target: ball; velocity: 200;
to:320-ball.width; //easing.type: Easing.OutBounce;
reversingMode: SmoothedAnimation.Immediate;
}
// PropertyAnimation{
// property: "x"; target: ball; //velocity: 200;
// to:240-ball.width; easing.type: Easing.OutBounce;
// duration: 1000;
// }
// PropertyAnimation {
// property: "y"; target: ball; //velocity: 200;
// to:320-ball.width; easing.type: Easing.OutBounce;
// duration: 1000;
// }
}
}
Button {
id:button
anchors.centerIn: parent
color: "lightgreen"; opacity: 0.5;
MouseArea {
anchors.fill: parent
onClicked: bounce.start()
}
}
}