Advertisement
peter9477

Untitled

Mar 1st, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import QtQuick 1.1
  2.  
  3. Rectangle {
  4.     width: 1024
  5.     height: 600
  6.     color: "pink"
  7.  
  8.     Text {
  9.         id: sometext
  10.         text: "Tap and drag"
  11.         scale: 3
  12.         x: (parent.width - width) / 2
  13.         y: (parent.height - height) / 2
  14.  
  15.         Component.onCompleted: {
  16.             myanim.start()
  17.         }
  18.  
  19.     }
  20.  
  21.     MouseArea {
  22.         anchors.fill: parent
  23.         onPositionChanged: {
  24.             sometext.x = mouse.x
  25.             sometext.y = mouse.y
  26.         }
  27.     }
  28.  
  29.     SequentialAnimation {
  30.         id: myanim
  31.         loops: Animation.Infinite
  32.  
  33.         ParallelAnimation {
  34.             NumberAnimation { target: sometext; property: "rotation";
  35.                 from: 0; to: 360; duration: 2000; easing.type: Easing.OutBack;
  36.             }
  37.             NumberAnimation { target: sometext; property: "opacity";
  38.                 from: 0; to: 1; duration: 2000; easing.type: Easing.InQuad;
  39.             }
  40.         }
  41.  
  42.         ParallelAnimation {
  43.             NumberAnimation { target: sometext; property: "rotation";
  44.                 from: 0; to: 360; duration: 2000; easing.type: Easing.OutBack;
  45.             }
  46.             NumberAnimation { target: sometext; property: "opacity";
  47.                 to: 0.1; duration: 2000; easing.type: Easing.InQuart;
  48.             }
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement