examples/quick/multipointtouch: move emitter instead of ParticleSystem
authorThomas Senyk <thomas.senyk@pelagicore.com>
Thu, 22 Nov 2012 15:19:30 +0000 (16:19 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 26 Nov 2012 20:51:51 +0000 (21:51 +0100)
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>
examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml
examples/quick/touchinteraction/multipointtouch/multiflame.qml

index f3c79a4..1d51f73 100644 (file)
@@ -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; }
index 7922acc..2697cd9 100644 (file)
@@ -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
     }
 }