summary refs log tree commit diff
path: root/resources/qml/ui/EmojiEmitter.qml
blob: 953b0352570719d71dab7d94178a4dfbe5ffd793 (plain) (blame)
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
import QtQuick 2.0
import QtQuick.Particles 2.0

Item {
    id: bg

    readonly property int velocity: 50

    ParticleSystem {
        id: particleSys
    }

    Emitter {
        id: particles

        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: parent.top
        width: parent.width
        system: particleSys
        emitRate: 10
        lifeSpan: (parent.height / bg.velocity) * 1000 //8000
        lifeSpanVariation: 1000
        maximumEmitted: 1000
        size: 5
        sizeVariation: 15

        velocity: AngleDirection {
            angle: 90
            angleVariation: 10
            magnitude: bg.velocity
        }

    }

    ItemParticle {
        id: particle

        system: particleSys
        delegate: itemDelegate
    }

    Component {
        id: itemDelegate

        Item {
            id: container

            x: bg.width / 2
            y: 0

            Text {
                anchors.fill: parent
                text: "🎉"
            }

        }

    }

}