Qt Forum

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

    Unsolved Random animation

    QML and Qt Quick
    2
    2
    508
    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.
    • M
      MartinD last edited by

      Hi,
      I want to animate property X or Y of my object and I want to change them -10 to +10 pixels from its current position (it will vibrate my object). I want to make N animations in one sequence (N = 8 to 20 and N is randomly selected at the beginning of the sequence). Every animation in the sequence must be regenerated to new random values on the sequence start.
      Can you please help with that?

      1 Reply Last reply Reply Quote 0
      • Lorenz
        Lorenz last edited by

        Hi,

        You can use JavaScript's Math.random() to generate random numbers in QML.

        Check out this older thread in the forum.

        Cheers,
        Lorenz

        Developer @ V-Play Engine - http://v-play.net/qt

        V-Play simplifies

        • Game Development with Qt
        • Mobile App Dev with Qt esp. iOS & Android

        What others say
        V-Play scored #1 in Cross-Platform App Development Tools Report - see why: https://goo.gl/rgp3rq

        1 Reply Last reply Reply Quote 2
        • First post
          Last post