Game Development Community

GUI catching mouse movement but no clicks

by Novack · in Torque Game Engine Advanced · 02/03/2010 (10:39 pm) · 0 replies

Hey guys. My head is about to implode after a couple of hours of this.

Background.
Im in a project which uses the YackPack extensively. When the player hits ESC, the game gets paused and shows the main menu screen, with the 'Play' button, replaced by 'Resume Game', pretty standard.

Difficulty.
When the player pauses the game while in Yack Pack dialog, by default, the dialog gets cutoff, because of the Canvas.setContent(MainMenu). I need to prevent that, as the dialogs are highly complex, and a sudden cut is traumatic for the game and the player.

Development.
So I opted for the Canvas.pushDialog(%gui) way. It went well initially, from PlayGUI to MainMenu, and back, with no issues.

Problem.
When the YackPack GUI is up, and I make the Canvas.pushDialog(MainMenu), something really bizarre happens: The MainMenu catches the mouse movement, but not the mouse clicks. I see the buttons reacting the mouse movement, but they dont feel the clicks at all.

But! If I open and close the console, it works again normally... (?!)

Could be related to the modal property of the GUIs? Both the MainMenu and the DialogGUI are modal. However I dont understand why it would catch part of the input.

I also played around with bringToFront and pushToBack, they do affect the order, but I keep getting the same behaviour at the MainMenu.

Finally, also fooled around with the layers (as in pushDialog(%gui, %layer)) but from what I understood of layers, it doesnt do with it (or I didnt got it right about layers, what is perfectly possible too).


To summarize, Im lost. Any thoughts will be most welcome.


Edit/Update: Talking with the project leader, we came to conclusion that is better (for more than this reason) to keep the player from pausing the game while in a dialog. So this problem looses drama, but still leaves me with a feeling of mistery.