alexhui's Forum Posts

  • 2 posts
  • I ran into the same problem but I couldn't use the Group Events method (I learned something new though!). I use the same code for buttons that are on or not on the pause menu, so I would end up either disabling all the buttons or none of them.

    If anyone runs into this too, my workaround is to add the following conditions:

    On touched <object>

    AND <object> is visible

    AND Layer <object.LayerName> is visible

    This way, I don't have to be specific about what menu is showing or not (i.e. I can reuse the code in other projects.).

    I added my two cents to http://www.scirra.com/forum/suggestion- ... 65704.html so I'm hoping we don't have to deal with these types of workarounds in the future. (Argh, I just realized there's a place I missed adding this workaround.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I agree with spongehammer and would like to make a similar suggestion.

    I finally figured out how to work around the issue by simply adding two conditions to my input events:

    On touched <object>

    AND <object> is visible

    AND Layer <object.LayerName> is visible

    However, I would like Construct 2 to automatically take care of this for me for the reasons that follow. The solution could be to make invisible objects or layers not respond to input events, or have an Enabled property that governs that.

    Why I'm making this suggestion:

    1. To keep the code clean and simple. Users shouldn't have to add additional conditions to every touch/input event.

    2. This is a trap for bugs. Looking at the forum posts, there are people who run into this and are puzzled. They tend to think invisible objects should be treated as if they're not there. After all, the game player wouldn't see anything to touch or click. A "pause layer" that covers the game is one possibly common way to run into this problem.

    3. As simple as the workaround may be, it still took me a good amount of time searching for forums to understand the issue and look for a fix. I'm sure Scirra wants to let its users focus on developing the game play, not these finicky details.

    If you don't take this suggestion, could you please at least mention in the reference manual that the touch events *do* fire for invisible objects or and objects on invisible layers? That way at least we are warned.

    Thanks for reading.

  • 2 posts