summaryrefslogtreecommitdiffstats
path: root/examples/declarative/particles/Trails/Swarm.qml
blob: 09d2705517ee9aca6789660b658352beee5aa314 (plain)
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
import QtQuick 2.0
import Qt.labs.particles 2.0 as QLP

Rectangle{
    width: 200
    height: 200
    color: "black"
    QLP.ParticleSystem{ id: ps }
    QLP.ColoredParticle{
        system: ps
        particles: ["star1","star2"]
        anchors.fill: parent
        clip: true
        image: "content/star.png"
    }
    QLP.Swarm{ 
        system: ps
        leaders: ["star2"]; 
        anchors.fill: parent
        strength: 128
    }
    QLP.TrailEmitter{
        anchors.fill: parent
        system: ps
        particle: "star1"
        particlesPerSecond: 100
        particleDuration: 2000
    }
    QLP.TrailEmitter{
        anchors.fill: parent
        system: ps
        particle: "star2"
        particlesPerSecond: 0.4
        particleDuration: 10000
        particleSize: 64
        particleEndSize: 32
    }
}