summaryrefslogtreecommitdiffstats
path: root/examples/declarative/particles/Trails/Portal.qml
blob: 8602bb71971ee7b850d35eb8df81ed0a2ed3b9fa (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import QtQuick 2.0
import Qt.labs.particles 2.0

Rectangle{
    id: root
    width: 360
    height: 540
    color: "black"
    Image{
        anchors.fill: parent
        source: "content/portal_bg.png"
    }
    ParticleSystem{ 
        id: particles 
        startTime: 2000
    }
    ColoredParticle{
        particles: ["center","edge"]
        anchors.fill: parent
        system: particles
        image: "content/particle.png"
        colorVariation: 0.1
        color: "lightsteelblue"
        additive: 1
    }
    TrailEmitter{
        anchors.fill: parent
        particle: "center"
        system: particles
        particlesPerSecond: 200
        particleDuration: 2000
        emitting: true
        particleSize: 20
        particleSizeVariation: 2
        particleEndSize: 0
        shape: Ellipse{fill: false}
        speed: DirectedVector{
            targetX: root.width/2 
            targetY: root.height/2
            proportionalMagnitude: true
            magnitude: 0.5
        }
    }
    TrailEmitter{
        anchors.fill: parent
        particle: "edge"
        system: particles
        particlesPerSecond: 2000
        particleDuration: 2000
        emitting: true
        particleSize: 20
        particleSizeVariation: 2
        particleEndSize: 0
        shape: Ellipse{fill: false}
        speed: DirectedVector{
            targetX: root.width/2 
            targetY: root.height/2
            proportionalMagnitude: true
            magnitude: 0.1
            magnitudeVariation: 0.1
        }
        acceleration: DirectedVector{
            targetX: root.width/2 
            targetY: root.height/2
            targetVariation: 200
            proportionalMagnitude: true
            magnitude: 0.1
            magnitudeVariation: 0.1
        }
    }
}