Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Game with buttons and stuff...
Qt 6.11 is out! See what's new in the release blog

Game with buttons and stuff...

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 562 Views 2 Watching
  • 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.
  • C Offline
    C Offline
    Constantly_Stuck
    wrote on last edited by
    #1

    I am a learner programmer trying to make a little game for my phone using QML. My game is controlled by a number of direction, speed and shoot buttons. I initially made my buttons out of images, using MouseArea inside them to respond to the user input, however have discovered that this means only one button will work at a time.

    I think I need to use MultiPointTouchArea in order to have more than one button working at once.
    My problem is how do I link the TouchPoints to the images on my buttons, so my application knows which button is pressed? There must be a simple way to do this...?

    Please can anybody help?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Constantly_Stuck
      wrote on last edited by
      #2

      Problem solved:
      I used a number of MultiPointTouchAreas - one for each of my buttons. That way I was able to define the rectangle area for each MultiPointTouchArea corresponding to each button.
      It works perfectly and sends a signal for each time a MultiPointTouchArea is pressed, regardless of whether other ones are already being pressed.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved