summaryrefslogtreecommitdiffstats
path: root/basicsuite/qt5-cinematicdemo/content/Background.qml
blob: f0225bafcfd526a504f75a0d31c72a661debe4a4 (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
import QtQuick 2.0
import QtQuick.Particles 2.0

Item {
    id: root

    anchors.fill: parent

    Image {
        id: backgroundImage
        anchors.fill: parent
        source: settings.showColors ? "images/background3.png" : "images/background.png"
        Behavior on source {
            SequentialAnimation {
                NumberAnimation { target: backgroundImage; property: "opacity"; to: 0; duration: 400; easing.type: Easing.InQuad }
                PropertyAction { target: backgroundImage; property: "source" }
                NumberAnimation { target: backgroundImage; property: "opacity"; to: 1; duration: 400; easing.type: Easing.OutQuad }
            }
        }
    }

    // Sky stars particles
    ParticleSystem {
        width: parent.width
        height: 220
        paused: detailsView.isShown || infoView.isShown || !settings.showShootingStarParticles
        ImageParticle {
            source: "images/star.png"
            rotationVariation: 10
        }
        Emitter {
            anchors.fill: parent
            emitRate: 4
            lifeSpan: 5000
            size: 48
            sizeVariation: 16
        }
    }
}