MarqueeText.qml
changeset 27 3d3f781bf543
parent 26 bb3f9b3c6416
child 28 8297924aa384
     1.1 --- a/MarqueeText.qml	Mon Jun 02 17:40:32 2014 +0200
     1.2 +++ b/MarqueeText.qml	Mon Jun 02 18:52:31 2014 +0200
     1.3 @@ -30,22 +30,25 @@
     1.4          //Reset to zero and restart onStopped so that we keep looping
     1.5          //onStopped: {scrollingText.x=0;running=true;}
     1.6  
     1.7 -        XAnimator {
     1.8 +        NumberAnimation {
     1.9              target: scrollingText;
    1.10 +            properties: "x"
    1.11              //from: 0;
    1.12              to: -scrollingText.width-separatorText.width;
    1.13              duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds
    1.14          }
    1.15  
    1.16 -        XAnimator {
    1.17 +        NumberAnimation {
    1.18              target: separatorText;
    1.19 +            properties: "x"
    1.20              from: separatorText.x;
    1.21              to: separatorText.x-scrollingText.width-separatorText.width;
    1.22              duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds
    1.23          }
    1.24  
    1.25 -        XAnimator {
    1.26 +        NumberAnimation {
    1.27              target: followingText;
    1.28 +            properties: "x"
    1.29              from: followingText.x;
    1.30              to: followingText.x-scrollingText.width-separatorText.width;
    1.31              duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds
    1.32 @@ -53,47 +56,13 @@
    1.33  
    1.34      }
    1.35  
    1.36 -
    1.37 -
    1.38 -
    1.39 -
    1.40 +    //Click to start
    1.41      MouseArea {
    1.42          id:mouseArea
    1.43          anchors.fill: parent
    1.44          onClicked: {
    1.45              animation.running=true;
    1.46 -            //animator.running=true;
    1.47 -            //otherAnimator.running=true;
    1.48 -            //scrollingText.x=-500;
    1.49 -
    1.50 -            //tempX = 0;
    1.51 -            //timer.running = true;
    1.52          }
    1.53  
    1.54      }
    1.55 -
    1.56 -
    1.57 -    /*
    1.58 -    Timer {
    1.59 -        id:timer
    1.60 -        interval: 33; running: false; repeat: true
    1.61 -        onTriggered:{
    1.62 -            tempX = tempX + 1
    1.63 -            scrollingText.x = -tempX;
    1.64 -
    1.65 -            if( tempX + marqueeText.width > scrollingText.width ) {
    1.66 -                timer.running = false
    1.67 -                pauseTimer.running = true
    1.68 -            }
    1.69 -        }
    1.70 -    }
    1.71 -
    1.72 -    Timer {
    1.73 -        id:pauseTimer
    1.74 -        interval: 500; running: false; repeat: false
    1.75 -        onTriggered: {
    1.76 -            scrollingText.x = 0
    1.77 -        }
    1.78 -    }
    1.79 -    */
    1.80  }