Feature or bug?

0 favourites
  • 6 posts
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • I encountered this issue and I wonder what your take on it might be.

    1, make 2 overlapping buttons on separate layers

    2, register tap event handlers for both - make sure if one is visible and onscreen, the other is invisible and offscreen

    3, when a button is tapped, toggle their state

    Tap event seemingly executes on both buttons, despite one being offscreen at the time of tap. Things become clear when I put a delay between tap and handler.

    Once button1 is tapped, button2 is made visible and moved into place beneath button1. That same tap event then propagates into button2, executing the inverse logic - hence the perception of no change unless button1 is tapped outside the overlapping area.

    I don't think this behaviour is correct and would like your opinion.

  • You can set a layer to interactive, true or false. So you turn off the whole layer not the single button. Doing the entire layer makes sense to me.

    I hope this helps.

    yours

    winkr7

  • I think you could create a global variable to determine which button you clicked and determine which button is at the top based on the state of the global variable.

  • You can set a layer to interactive, true or false. So you turn off the whole layer not the single button. Doing the entire layer makes sense to me.

    I hope this helps.

    yours

    winkr7

    I did not mention it but yes, the other layer is actually not interactive at the time of touch. Still the touch registers. As I said, the same touch registers on both buttons despite the other one not being interactive, visible, not even in the same spot as I move it away from screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think you could create a global variable to determine which button you clicked and determine which button is at the top based on the state of the global variable.

    That sounds like a workaround but hopefully there's a better solution. In fact, just using a delay in execution works fine.

  • This feature has been around for a long time.

    The same will happen if you create one button with two frames of animation. And when you press it, you will switch the frame number. If you don't add a delay it won't work well.

    As I understood the processing of the touch takes some time and during this time several conditions have time to work.

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