summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-10-21 04:43:22 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-10-21 04:43:22 (GMT)
commit2b7c33da538e1fd596c679a089c1949cc8651103 (patch)
tree33a2ac17cee58b74d73db2234a617ffac8b31ba8 /examples
parentc5a13f58a24487c1240e5592a5c40e5420a5cc35 (diff)
downloadQt-2b7c33da538e1fd596c679a089c1949cc8651103.zip
Qt-2b7c33da538e1fd596c679a089c1949cc8651103.tar.gz
Qt-2b7c33da538e1fd596c679a089c1949cc8651103.tar.bz2
add color-animation example
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/animation/color-animation.qml72
-rw-r--r--examples/declarative/animation/images/moon.pngbin0 -> 2433 bytes
-rw-r--r--examples/declarative/animation/images/star.pngbin0 -> 349 bytes
-rw-r--r--examples/declarative/animation/images/sun.pngbin0 -> 8153 bytes
4 files changed, 72 insertions, 0 deletions
diff --git a/examples/declarative/animation/color-animation.qml b/examples/declarative/animation/color-animation.qml
new file mode 100644
index 0000000..04ec0bf
--- /dev/null
+++ b/examples/declarative/animation/color-animation.qml
@@ -0,0 +1,72 @@
+import Qt 4.6
+
+Item {
+ id: window
+ width: 640; height: 480
+
+ // Let's draw the sky...
+ Rectangle {
+ anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: SequentialAnimation {
+ running: true; repeat: true
+ ColorAnimation { from: "DeepSkyBlue"; to: "#141450"; duration: 5000 }
+ ColorAnimation { from: "#141450"; to: "DeepSkyBlue"; duration: 5000 }
+ }
+ }
+ GradientStop {
+ position: 1.0
+ color: SequentialAnimation {
+ running: true; repeat: true
+ ColorAnimation { from: "SkyBlue"; to: "#437284"; duration: 5000 }
+ ColorAnimation { from: "#437284"; to: "SkyBlue"; duration: 5000 }
+ }
+ }
+ }
+ Particles {
+ anchors.fill:parent; source: "images/star.png"; angleDeviation: 360; velocity: 0
+ velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800
+ opacity: SequentialAnimation {
+ running: true; repeat: true
+ NumberAnimation { from: 0; to: 1; duration: 5000 }
+ NumberAnimation { from: 1; to: 0; duration: 5000 }
+ }
+ }
+ }
+
+ Item {
+ id: space
+ width: parent.width; height: 2 * parent.height
+ transformOrigin: "Center"
+ rotation: SequentialAnimation {
+ running: true; repeat: true
+ NumberAnimation { from: 0; to: 360; duration: 10000 }
+ }
+ Image {
+ source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter
+ transformOrigin: "Center"; rotation: -space.rotation
+ }
+ Image {
+ source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter
+ transformOrigin: "Center"; rotation: -space.rotation
+ }
+ }
+
+ // ...and the ground.
+ Rectangle {
+ anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: SequentialAnimation {
+ running: true; repeat: true
+ ColorAnimation { from: "ForestGreen"; to: "#001600"; duration: 5000 }
+ ColorAnimation { from: "#001600"; to: "ForestGreen"; duration: 5000 }
+ }
+ }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+}
diff --git a/examples/declarative/animation/images/moon.png b/examples/declarative/animation/images/moon.png
new file mode 100644
index 0000000..9407b2b
--- /dev/null
+++ b/examples/declarative/animation/images/moon.png
Binary files differ
diff --git a/examples/declarative/animation/images/star.png b/examples/declarative/animation/images/star.png
new file mode 100644
index 0000000..27ef924
--- /dev/null
+++ b/examples/declarative/animation/images/star.png
Binary files differ
diff --git a/examples/declarative/animation/images/sun.png b/examples/declarative/animation/images/sun.png
new file mode 100644
index 0000000..7713ca5
--- /dev/null
+++ b/examples/declarative/animation/images/sun.png
Binary files differ