summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKimmo Ollila <kimmo.ollila@digia.com>2013-05-28 12:02:15 +0300
committerLasse Räihä <lasse.raiha@digia.com>2013-05-28 12:11:31 +0300
commit64a57421576d092b54eef71b2f13c3eae4e4ddf5 (patch)
tree7be5121d09be0c57fd99bd39fcba487160a2b97b
parent3d785514a22473b5d815298772afe9933550317d (diff)
Added skipping feature to boot-up animation
Change-Id: I1d1ab20e105cc1562edc0b86d678e57a44621454 Reviewed-by: Lasse Räihä <lasse.raiha@digia.com>
-rw-r--r--QtDemo/qml/QtDemo/demos/particledemo/BootScreenDemo.qml95
-rw-r--r--QtDemo/qml/QtDemo/demos/particledemo/particledemo.qml1
2 files changed, 49 insertions, 47 deletions
diff --git a/QtDemo/qml/QtDemo/demos/particledemo/BootScreenDemo.qml b/QtDemo/qml/QtDemo/demos/particledemo/BootScreenDemo.qml
index 4cbe44e..3b40589 100644
--- a/QtDemo/qml/QtDemo/demos/particledemo/BootScreenDemo.qml
+++ b/QtDemo/qml/QtDemo/demos/particledemo/BootScreenDemo.qml
@@ -9,51 +9,36 @@ Item {
SequentialAnimation {
id: entryAnimation
running: true
- ParallelAnimation {
- SequentialAnimation {
- PropertyAction { target: sphereEmitter; property: "emitRate"; value: 100 }
- PropertyAction { target: starEmitter; property: "emitRate"; value: 50 }
-
- PropertyAction { target: starEmitter; property: "enabled"; value: true }
- PropertyAction { target: sphereEmitter; property: "enabled"; value: true }
-
- PropertyAction { target: sphereSystem; property: "running"; value: true }
- PropertyAction { target: starSystem; property: "running"; value: true }
- PauseAnimation { duration: 3000 }
- PropertyAction { target: sphereEmitter; property: "emitRate"; value: 200 }
- PropertyAction { target: starEmitter; property: "emitRate"; value: 200 }
- PauseAnimation { duration: 3000 }
- ScriptAction { script: {
- starAccel.x = 5
- starAccel.xVariation = 20;
- starAccel.yVariation = 20;
- sphereAccel.x = -5
- sphereAccel.xVariation = 20
- sphereAccel.yVariation = 20
- sphereParticle.alpha = 0;
- }
- }
- PauseAnimation { duration: 1000 }
- PropertyAction { target: starEmitter; property: "enabled"; value: false }
- PropertyAction { target: sphereEmitter; property: "enabled"; value: false }
- PauseAnimation { duration: 5000 }
-
- ScriptAction { script: {
- starAccel.x = 0
- starAccel.xVariation = 0;
- starAccel.yVariation = 0;
- sphereAccel.x = 0
- sphereAccel.xVariation = 1
- sphereAccel.yVariation = 1
- sphereParticle.alpha = 1;
- }
- }
- }
- SequentialAnimation {
- PauseAnimation { duration: 5000 }
+ PropertyAction { target: sphereEmitter; property: "emitRate"; value: 150 }
+ PropertyAction { target: starEmitter; property: "emitRate"; value: 100 }
+ PropertyAction { target: starEmitter; property: "enabled"; value: true }
+ PropertyAction { target: sphereEmitter; property: "enabled"; value: true }
+ PropertyAction { target: sphereSystem; property: "running"; value: true }
+ PropertyAction { target: starSystem; property: "running"; value: true }
+ PauseAnimation { duration: 5000 }
+
+ onRunningChanged: if (!running) explodeAnimation.restart()
+ }
+ SequentialAnimation{
+ id: explodeAnimation
+ ScriptAction { script: {
+ starAccel.x = 5
+ starAccel.xVariation = 20;
+ starAccel.yVariation = 20;
+ sphereAccel.x = -5
+ sphereAccel.xVariation = 20
+ sphereAccel.yVariation = 20
+ sphereParticle.alpha = 0;
}
}
+ PropertyAction { target: sphereEmitter; property: "emitRate"; value: 200 }
+ PropertyAction { target: starEmitter; property: "emitRate"; value: 200 }
+ PauseAnimation { duration: 2000 }
+ PropertyAction { target: starEmitter; property: "enabled"; value: false }
+ PropertyAction { target: sphereEmitter; property: "enabled"; value: false }
+ PauseAnimation { duration: 5000 }
+
onRunningChanged: {
if (!running) {
root.finished()
@@ -61,6 +46,7 @@ Item {
}
}
}
+
Item {
id: logo;
width: root.size / 2;
@@ -71,7 +57,6 @@ Item {
ParticleSystem {
id: sphereSystem;
anchors.fill: logo
-
running: false
ImageParticle {
@@ -87,7 +72,7 @@ Item {
anchors.fill: parent
emitRate: 100
lifeSpan: 4000
- size: root.width*.1
+ size: root.width*.15
sizeVariation: size *.2
velocity: PointDirection { xVariation: 2; yVariation: 2; }
@@ -106,7 +91,6 @@ Item {
ParticleSystem {
id: starSystem;
anchors.fill: logo
-
running: false
ImageParticle {
@@ -122,10 +106,10 @@ Item {
anchors.fill: parent
emitRate: 50
lifeSpan: 5000
- size: root.width*.05
+ size: root.width*.1
sizeVariation: size *.2
-
velocity: PointDirection { xVariation: 1; yVariation: 1; }
+
acceleration: PointDirection {
id: starAccel
xVariation: 0;
@@ -137,4 +121,21 @@ Item {
}
}
}
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+
+ if (entryAnimation.running) {
+ entryAnimation.complete()
+ return;
+ }
+
+ if (explodeAnimation.running) {
+ root.finished()
+ root.destroy()
+ }
+
+ }
+ }
}
diff --git a/QtDemo/qml/QtDemo/demos/particledemo/particledemo.qml b/QtDemo/qml/QtDemo/demos/particledemo/particledemo.qml
index 433b7e6..f09cfb0 100644
--- a/QtDemo/qml/QtDemo/demos/particledemo/particledemo.qml
+++ b/QtDemo/qml/QtDemo/demos/particledemo/particledemo.qml
@@ -16,6 +16,7 @@ Rectangle {
width: Math.min(parent.width,parent.height)
height: width
anchors.centerIn: parent
+ z: 1
onFinished: {
distanceAnimation.restart()
angleAnimation.restart()