summaryrefslogtreecommitdiffstats
path: root/examples/declarative/particles/Trails/Rainbow.qml
blob: db553586c70ed0c183db72d0b4bc09830eadab26 (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
39
40
41
import Qt.labs.particles 2.0
import QtQuick 2.0

Rectangle {
    id: root
    width: 360
    height: 540
    color: "black"

    ParticleSystem{ id: particles }
    ColoredParticle{
        system: particles
        colorVariation: 0.5
        additive: 1

        image: "content/particle.png"
        colortable: "content/colortable.png"
    }
    TrailEmitter{
        system: particles
        particlesPerSecond: 500
        particleDuration: 2000

        y: root.height / 2 + Math.sin(t * 2) * root.height * 0.3
        x: root.width / 2 + Math.cos(t) * root.width * 0.3
        property real t;

        NumberAnimation on t {
            from: 0; to: Math.PI * 2; duration: 10000; loops: Animation.Infinite
        }

        speedFromMovement: 20

        speed: PointVector{ xVariation: 5; yVariation: 5;}
        acceleration: PointVector{ xVariation: 5; yVariation: 5;}

        particleSize: 2
        particleEndSize: 8
        particleSizeVariation: 8
    }
}