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.
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 ?
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.
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.
Develop games in your browser. Powerful, performant & highly capable.
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.