diff options
Diffstat (limited to 'examples/declarative/particles/snow/snow.qml')
-rw-r--r-- | examples/declarative/particles/snow/snow.qml | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/examples/declarative/particles/snow/snow.qml b/examples/declarative/particles/snow/snow.qml index 25d2e1468b..2be2438f1d 100644 --- a/examples/declarative/particles/snow/snow.qml +++ b/examples/declarative/particles/snow/snow.qml @@ -39,15 +39,16 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 +import "content" Rectangle{ width: 360 height: 540 ParticleSystem { id: particles } - SpriteParticle { + ImageParticle { system: particles - Sprite{ + sprites: Sprite{ name: "snow" source: "content/flake-01.png" frames: 51 @@ -55,21 +56,38 @@ Rectangle{ } } Wander { + id: wanderer system: particles anchors.fill: parent - xVariance: 40; - pace: 40; + xVariance: 360/(wanderer.physics+1); + pace: 100*(wanderer.physics+1); } - TrailEmitter { + Emitter { system: particles particlesPerSecond: 20 particleDuration: 7000 emitting: true - speed: PointVector{ y:80; yVariation: 40; } - acceleration: PointVector{ y: 4 } + speed: PointDirection{ y:80; yVariation: 40; } + acceleration: PointDirection{ y: 4 } particleSize: 20 particleSizeVariation: 10 width: parent.width height: 100 } + Row{ + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + Button{ + text:"dx/dt" + onClicked: wanderer.physics = Wander.Position; + } + Button{ + text:"dv/dt" + onClicked: wanderer.physics = Wander.Velocity; + } + Button{ + text:"da/dt" + onClicked: wanderer.physics = Wander.Acceleration; + } + } } |