diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-07-20 01:03:14 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-07-20 01:03:14 (GMT) |
commit | 7c0a59857cf7a74eb16ba4186b10514f159b7aab (patch) | |
tree | 6ab6aa6528702c60a1cb07273130c7cade5aa39d | |
parent | a1e83cdc5c30495a6110e8c8f11ae28723e2b0d5 (diff) | |
download | Qt-7c0a59857cf7a74eb16ba4186b10514f159b7aab.zip Qt-7c0a59857cf7a74eb16ba4186b10514f159b7aab.tar.gz Qt-7c0a59857cf7a74eb16ba4186b10514f159b7aab.tar.bz2 |
Fixup minehunt example with the new style particle explosions
Note that there seems to be a bug still with when the RunScriptAction
is called.
-rw-r--r-- | examples/declarative/minehunt/Explosion.qml | 15 | ||||
-rw-r--r-- | examples/declarative/minehunt/minehunt.qml | 7 |
2 files changed, 18 insertions, 4 deletions
diff --git a/examples/declarative/minehunt/Explosion.qml b/examples/declarative/minehunt/Explosion.qml index 2886559..84e93d4 100644 --- a/examples/declarative/minehunt/Explosion.qml +++ b/examples/declarative/minehunt/Explosion.qml @@ -2,17 +2,26 @@ Item { property bool explode : false Particles { + id: particles width: 38 height: 21 - lifeSpan: 3600000 + lifeSpan: 1000 lifeSpanDeviation: 0 source: "pics/star.png" - count: 200 + count: 0 angle: 270 angleDeviation: 360 velocity: 100 velocityDeviation: 20 z: 100 - emitting: explode + opacity: 0 + streamIn: false } + states: [ State { name: "exploding"; when: explode == true + SetProperties { target: particles; count: 200 } + SetProperties { target: particles; opacity: 1 } + SetProperties { target: particles; emitting: false } // i.e. emit only once + } + ] + } diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml index 286e485..3dc1da4 100644 --- a/examples/declarative/minehunt/minehunt.qml +++ b/examples/declarative/minehunt/minehunt.qml @@ -55,9 +55,10 @@ Item { opacity: modelData.hasMine } Explosion { + id: expl anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - explode: modelData.hasMine && modelData.flipped + //explode: modelData.hasMine && modelData.flipped//Doesn't wait for the pause } } states: [ @@ -89,6 +90,10 @@ Item { easing: "easeInOutQuad" properties: "rotation" } + RunScriptAction{ + script: if(modelData.hasMine && modelData.flipped) + {expl.explode = true;} + } } } ] |