Qt Forum

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

    Mouse drag on specific area.

    General and Desktop
    2
    5
    956
    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.
    • H
      heatblazer last edited by

      Hello, Im doing it again. Next game with another challenge for my 1 month Qt expirience. I have to make a train moving on the trails: https://www.flickr.com/photos/heatblazer/15453957743/ The picture shows the trails. The user must drag the train in the exact trails, no other space. Ive predefined invisible curves to match the rails so collision deteciton is OK. But this is the test picture, the final one will have a choice of the roads so I need to know what classes will I need. Just point me the way, I`ll to it on my own from there on.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Sounds like you should either use the QGraphicsScene framework or QML

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • H
          heatblazer last edited by

          I am using QGraphicsScene. The queston is if there is an API to move the train on the rails with curves so if user drags up and there is a curved rail, the train must curve there too even the mouse is not.
          [quote author="SGaist" date="1419200763"]Hi,

          Sounds like you should either use the QGraphicsScene framework or QML[/quote]

          1 Reply Last reply Reply Quote 0
          • H
            heatblazer last edited by

            If I can add invisible boundries, will the user be forced to curve to them? I wonder.

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              Makes me think of "collidesWithPath":http://doc.qt.io/qt-5/qgraphicsitem.html#collidesWithPath

              Note that I haven't used it

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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