How do I control Touches

  • Playing with mobile development. I have a problem when using touch and selecting submenus. For example,

    There are several sprites on screen, any one of them can be selected. I touch one and it brings up an interactive menu, or sprite representing such a menu. The problem is if I touch this menu and there is a selectable sprite underneath, it may also get selected. Is there a way to avoid this using layers or someway where touch is enabled for only certain objects at a time? Hoping to get a few quick suggestions so I can get back on track.

  • This could be handled multiple ways..

    You could add conditions for is on layer, z-order, visibility or add a boolean instance variable selectable=true and check that..

  • Thank you for the input. I was using a boolean on the selectable sprites, I foresaw a problem when I noticed that they could be re-selected whilst overlapped by the menu, resulting in a possible change of that menu relating to the previously selected sprite. I need to narrow the condition better, like passing another variable from the sprite to the menu while it is visible so that in this instance of visibility, the menu only affects the previously selected sprite. I think...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Be sure to use else statements..

    There's a big chance multiple events are true at the same time and the last one will be executed..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)