Skip to content

Instantly share code, notes, and snippets.

@amclain
Created July 6, 2014 17:47
Show Gist options
  • Save amclain/09eae469da4e0c3c3b0b to your computer and use it in GitHub Desktop.
Save amclain/09eae469da4e0c3c3b0b to your computer and use it in GitHub Desktop.
import QtQuick 2.2
import QtQuick.Particles 2.0
import QtQuick.Controls 1.2
Rectangle {
id: root
width: 400
height: 400
color: "white"
Button { onClicked: emitter.burst(50) }
ParticleSystem {
anchors.fill: parent
ImageParticle {
// http://i.imgur.com/WNdEXVV.png
source: "jag.png"
rotationVelocityVariation: 2
colorVariation: 0.2
}
Emitter {
id: emitter
width: parent.width
height: 30
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
emitRate: 1
lifeSpan: 12000
lifeSpanVariation: 2000
size: 100
endSize: 0
sizeVariation: 50
velocity: TargetDirection {
targetY: root.height * -1
magnitude: 10
magnitudeVariation: 5
}
}
Gravity {
angle: -90
magnitude: 5
}
Turbulence {
width: parent.width
height: parent.height
strength: 3
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment