aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-12-12 11:32:32 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-14 04:48:07 +0100
commitf5dbae43343be8051ddffea7b3505844a24b3948 (patch)
treed6a2902d0c0c5014f7065121880e0c70589dd22d /examples
parent99ada06f52876038e01d8ee872f6ea260ce20591 (diff)
Augment Samegame with resource efficient particle system
The particle system cannot automatically turn itself off when it's not needed, however it is easy enough to do so manually. This change does so in SameGame as an example. Task-number: QTBUG-22923 Change-Id: I5f2b3e572222f03c9412fd24c40276529e7d0e7e Reviewed-by: Alan Alpert <alan.alpert@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/samegame/SamegameCore/BoomBlock.qml2
-rw-r--r--examples/declarative/samegame/SamegameCore/GameArea.qml1
2 files changed, 2 insertions, 1 deletions
diff --git a/examples/declarative/samegame/SamegameCore/BoomBlock.qml b/examples/declarative/samegame/SamegameCore/BoomBlock.qml
index e5d4f4090b..1ea5c47b82 100644
--- a/examples/declarative/samegame/SamegameCore/BoomBlock.qml
+++ b/examples/declarative/samegame/SamegameCore/BoomBlock.qml
@@ -104,7 +104,7 @@ Item {
State {
name: "DeathState"; when: dying == true
- StateChangeScript { script: particles.pulse(100); }
+ StateChangeScript { script: {particleSystem.paused = false; particles.pulse(100);} }
PropertyChanges { target: img; opacity: 0 }
StateChangeScript { script: block.destroy(1000); }
}
diff --git a/examples/declarative/samegame/SamegameCore/GameArea.qml b/examples/declarative/samegame/SamegameCore/GameArea.qml
index 9a8f68ad89..5628ee00b4 100644
--- a/examples/declarative/samegame/SamegameCore/GameArea.qml
+++ b/examples/declarative/samegame/SamegameCore/GameArea.qml
@@ -63,6 +63,7 @@ Item {
}
ParticleSystem{
id: particleSystem;
+ onEmptyChanged: if (empty) paused = true;
z:2
ImageParticle {
groups: ["red"]