I’m trying to make a window that can be moved by dragging the header and can be closed by clicking the “X” button. The problem is that when I have multiple windows on the screen, they all get killed when I close one.
I’ve tried using global and local variables for the window id and header, but it doesn’t seem to work correctly. I’ve also tried using the stickers extension to stick the window to the header, but I still can’t close the window without removing all the others.
Your first event doesn’t filter the windows with a condition, and so the action is done on all of the windows.
Since you are using the Sticker extension to link the window and quit button, try adding the Quit is stuck to Window condition to the first event. I’m not 100% sure if the condition will filter the windows, or just return true/false.
Also, keep in mind that if you remove a window, you’ll need to unstick all objects that are stuck to it, remove them too. If you don’t unstick, it can lead to strange game behaviour.