0 Favourites

How do I disable click on lower window when a upper window

  • How can I disable windows that are overlapping.

    In my game there are message windows that overrides other windows.

    When this message window is displayed, the buttons on the bottom screen can be clicked.

    How can I disable the lower windows when the top is displayed?

    Ex: A window to purchase items that show a message to purchase made and disables the click of items in window.

    Thanks in advance an sorry about my poor english. English is not my first language.

  • Turn collision for them off when you don't want them active and visibility off when you don't want them seen.

  • chrisinfinger

    Does turn off collision works if the window is only sprite ?

    Or i need to set another behaviour specific ( like solid , for ex ) for this ?

    Thanks

  • One solution would be to hide the layer (set layer invisible) with the buttons underneath and have the top sprite on a separate layer.

    What I was referring to earlier was for you to turn off the collision for the buttons underneath when the top sprite is displayer (a button only works if its collision is enabled) and if you also want them to disappear when the top sprite is displayed to set them invisible as well when top one is active. Reverse process when top sprite is closed.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • one way to do it would be to create a global variable (eg POPUP_ACTIVE) that disables the buttons if set.. so when your popup appears, set this value to 1 (for example) and then use the following conditions. When the popup is disabled, set the variable back to zero

    if OBJECT clicked

    if POPUP_ACTIVE not equal to 1

    <do what you want now>

    that way if they are clicked, you won't do anything.

  • By far my favorite way to do this is put the events in groups and activating/de-activating the groups when needed..

    So all clicks/touches concerning anything other than the menu-clicks would be in a de-activated group..

  • thanks for all reply.

    i will try all methods described here and see what is the best for my case.

    Thanks again

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
410 84,618
MrMegawatts's avatar
MrMegawatts
Unread hot topic
232 177,682
Tetriser's avatar
Tetriser
Unread hot topic
99 10,149
karshinkoff's avatar
karshinkoff