-
Notifications
You must be signed in to change notification settings - Fork 368
/
Copy pathCircleHeart.qml
61 lines (52 loc) · 1.52 KB
/
CircleHeart.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
55
56
57
58
59
60
61
import QtQuick 2.12
import QtQuick.Particles 2.12
Item {
id: control
ParticleSystem {
id: sys
width: 300
height: 300
anchors.centerIn: parent
ImageParticle {
anchors.fill: parent
system: sys
source: "qrc:/heart_1.png"
color: Qt.rgba(0,0.5,0,0.8)
//colorVariation: 0.5 //彩色效果
}
Emitter {
id: emitter
//anchors.fill: parent
system: sys
emitRate: 10 //发射速率
lifeSpan: 5000 //生存周期ms
size: 25 //尺寸
sizeVariation: 5
// 移动效果
velocityFromMovement: 8
velocity: PointDirection {xVariation: 2; yVariation: 2;}
acceleration: PointDirection {xVariation: 10; yVariation: 10;}
x:circle.cx
y:circle.cy
}
Rectangle{
//测试范围用的矩形
z: -1
anchors.fill: parent
border.color: "green"
color: "transparent"
}
}
Item {
id: circle
property real radius: 100
property real cx: radius * Math.sin(percent*2*Math.PI)+sys.width/2
property real cy: radius * Math.cos(percent*2*Math.PI)+sys.height/2
property real percent: 0
SequentialAnimation on percent {
loops: Animation.Infinite
running: true
NumberAnimation { from: 0.0; to: 1 ; duration: 5000; }
}
}
}