2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2021-11-08 15:46:32 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Particles
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2011-09-20 07:16:36 +00:00
|
|
|
Rectangle {
|
2011-04-27 12:13:26 +00:00
|
|
|
width: 360
|
|
|
|
height: 540
|
|
|
|
color: "black"
|
2012-06-18 04:13:31 +00:00
|
|
|
Text {
|
2023-03-23 16:12:52 +00:00
|
|
|
text: qsTr("Left click to start/stop\nRight click to pause/unpause")
|
2012-06-18 04:13:31 +00:00
|
|
|
color: "white"
|
|
|
|
font.pixelSize: 24
|
|
|
|
}
|
2023-03-23 16:12:52 +00:00
|
|
|
|
|
|
|
TapHandler {
|
2011-09-01 05:27:05 +00:00
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
2023-03-23 16:12:52 +00:00
|
|
|
onTapped: function (event, mouseButton)
|
|
|
|
{
|
|
|
|
if (mouseButton === Qt.LeftButton)
|
2011-09-01 05:27:05 +00:00
|
|
|
particles.running = !particles.running
|
|
|
|
else
|
|
|
|
particles.paused = !particles.paused;
|
|
|
|
}
|
2011-04-27 12:13:26 +00:00
|
|
|
}
|
2011-09-20 07:16:36 +00:00
|
|
|
|
|
|
|
ParticleSystem {
|
|
|
|
id: particles
|
2011-04-27 12:13:26 +00:00
|
|
|
running: false
|
|
|
|
}
|
2011-09-20 07:16:36 +00:00
|
|
|
|
|
|
|
ImageParticle {
|
2011-04-27 12:13:26 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
system: particles
|
2013-04-01 20:45:21 +00:00
|
|
|
source: "qrc:///particleresources/star.png"
|
2021-11-08 15:46:32 +00:00
|
|
|
sizeTable: "images/sparkleSize.png"
|
2011-04-27 12:13:26 +00:00
|
|
|
alpha: 0
|
|
|
|
colorVariation: 0.6
|
|
|
|
}
|
2011-09-20 07:16:36 +00:00
|
|
|
|
|
|
|
Emitter {
|
2011-04-27 12:13:26 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
system: particles
|
2011-06-08 07:55:41 +00:00
|
|
|
emitRate: 2000
|
|
|
|
lifeSpan: 2000
|
|
|
|
size: 30
|
|
|
|
sizeVariation: 10
|
2011-04-27 12:13:26 +00:00
|
|
|
}
|
|
|
|
}
|