Last active
September 3, 2015 22:05
-
-
Save benaryorg/4a0d162ef447594f8768 to your computer and use it in GitHub Desktop.
qml button particles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
import QtQuick.Particles 2.0 | |
import QtQuick.Window 2.0 | |
import QtQuick.Controls 1.2 | |
Window | |
{ | |
visible: true | |
Rectangle | |
{ | |
id: root | |
anchors.fill: parent | |
color: "#1f1f1f" | |
ParticleSystem | |
{ | |
id: particleSystem | |
Gravity | |
{ | |
anchors.fill: parent | |
angle: 0 | |
magnitude: 100 | |
} | |
} | |
Emitter | |
{ | |
id: emitter | |
width: parent.width*.9 | |
height: 10 | |
anchors.bottom: parent.bottom | |
anchors.horizontalCenter: parent.horizontalCenter | |
system: particleSystem | |
emitRate: 2 | |
lifeSpan: 5000 | |
velocity: AngleDirection | |
{ | |
angle: 270 | |
angleVariation: 45 | |
magnitude: 200 | |
} | |
} | |
ItemParticle | |
{ | |
delegate: Button | |
{ | |
text: "Quit" | |
rotation: Math.random()*360 | |
onClicked: | |
{ | |
Qt.quit(); | |
} | |
} | |
system: particleSystem | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment