aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/pointerhandlers/multiflame.qml
blob: 7793e52ad6473491bfa1de3c1deabfcd3ef79c28 (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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick
import QtQuick.Particles

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

    component ColoredEmitter: Emitter {
        id: emitter
        property string color
        group: color
        velocityFromMovement: 10
        emitRate: 80
        lifeSpan: 1500
        velocity: PointDirection {
            y: -90
            yVariation: 50
        }
        acceleration: PointDirection {
            xVariation: 100
            yVariation: 90
        }
        size: 51
        sizeVariation: 53
        endSize: 64
        enabled: handler.active
        x: handler.point.position.x
        y: handler.point.position.y

        PointHandler {
            id: handler
            parent: root
        }

        ImageParticle {
            id: img
            groups: [emitter.color]
            source: "images/blur-circle.png"
            colorVariation: 0.1
            color: emitter.color
            alpha: 0
            system: sys
        }
    }

    ParticleSystem {
        id: sys
        ColoredEmitter {
            color: "indianred"
        }
        ColoredEmitter {
            color: "greenyellow"
        }
        ColoredEmitter {
            color: "yellow"
        }
        ColoredEmitter {
            color: "darkorange"
        }
        ColoredEmitter {
            color: "violet"
        }
    }
}