From cf5c84959805b6ede17b5bd5311f3433b8ccf6bd Mon Sep 17 00:00:00 2001 From: Thomas Senyk Date: Thu, 22 Nov 2012 16:19:30 +0100 Subject: examples/quick/multipointtouch: move emitter instead of ParticleSystem When you move the ParticleSystem, the existing particles will be moved as well. If you move the emitter, only new particles will be moved. Additional the velocityFromMovement adds a nice effect. Change-Id: I58eeb1fecde1ca24631400676049e5f9a06518de Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> --- .../multipointtouch/content/ParticleFlame.qml | 7 ++++++- .../touchinteraction/multipointtouch/multiflame.qml | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'examples/quick/touchinteraction') diff --git a/examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml b/examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml index f3c79a4daa..1d51f73898 100644 --- a/examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml +++ b/examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml @@ -42,6 +42,11 @@ import QtQuick 2.0 import QtQuick.Particles 2.0 ParticleSystem { + anchors.fill: parent + + property alias emitterX: emitter.x + property alias emitterY: emitter.y + property alias color: img.color property alias emitting: emitter.enabled ImageParticle { @@ -53,7 +58,7 @@ ParticleSystem { } Emitter { id: emitter - velocityFromMovement: 20 + velocityFromMovement: 10 emitRate: 80 lifeSpan: 1500 velocity: PointDirection{ y: -90; yVariation: 50; } diff --git a/examples/quick/touchinteraction/multipointtouch/multiflame.qml b/examples/quick/touchinteraction/multipointtouch/multiflame.qml index 7922acc6c4..2697cd94b7 100644 --- a/examples/quick/touchinteraction/multipointtouch/multiflame.qml +++ b/examples/quick/touchinteraction/multipointtouch/multiflame.qml @@ -63,33 +63,33 @@ Rectangle { //! [1] ParticleFlame { color: "red" - x: touch1.x - y: touch1.y + emitterX: touch1.x + emitterY: touch1.y emitting: touch1.pressed } //! [1] ParticleFlame { color: "green" - x: touch2.x - y: touch2.y + emitterX: touch2.x + emitterY: touch2.y emitting: touch2.pressed } ParticleFlame { color: "yellow" - x: touch11.x - y: touch11.y + emitterX: touch11.x + emitterY: touch11.y emitting: touch11.pressed } ParticleFlame { color: "blue" - x: touch21.x - y: touch21.y + emitterX: touch21.x + emitterY: touch21.y emitting: touch21.pressed } ParticleFlame { color: "violet" - x: touch31.x - y: touch31.y + emitterX: touch31.x + emitterY: touch31.y emitting: touch31.pressed } } -- cgit v1.2.3