Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] I want to change x axis of image:

    QML and Qt Quick
    2
    5
    1953
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DanSiddiqui last edited by

      I implement following code in qt qml:
      @
      Image {
      id: img
      x: 0
      y: 19
      source: "images/bubble.png"

          SequentialAnimation on y {
              loops: Animation.Infinite
              NumberAnimation { from:10;  to: 640; easing.type: Easing.InCirc; duration: 8000 }
              PauseAnimation { duration: 200 }
          }
      
      
      }
      

      @

      after completing animation on y axis i want to generate random number and pass it to the x of the image plz help;

      1 Reply Last reply Reply Quote 0
      • T
        task_struct last edited by

        Your animation wont finish. Its infinite. I suppose you want to change x after Number or Pause animation. You can use "ScriptAction":http://doc.qt.nokia.com/4.7-snapshot/qml-scriptaction.html

        @
        ScriptAction {
        script: img.x = Math.random() * MaxX
        }
        @

        where MaxX is maximum x value that picture can have.

        "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

        • Linu...
        1 Reply Last reply Reply Quote 0
        • D
          DanSiddiqui last edited by

          Thanks task_struct:
          its workinggggggg :)

          1 Reply Last reply Reply Quote 0
          • D
            DanSiddiqui last edited by

            One more thing task_struct it is posible to set animated gif as a background in my qml page.

            1 Reply Last reply Reply Quote 0
            • T
              task_struct last edited by

              Yes. See "AnimatedImage":http://doc.qt.nokia.com/4.7-snapshot/qml-animatedimage.html

              "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

              • Linu...
              1 Reply Last reply Reply Quote 0
              • First post
                Last post