Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Knox on Mon 28/06/2010 13:48:34

Title: Mouse click debugging on menu GUI's is confusing for me **SOLVED**
Post by: Knox on Mon 28/06/2010 13:48:34
Hi,

This probably is something very simple once again but I dont understand the "why" of this little "problem":

Currently Im debugging something and I placed these lines in my on_mouse_click in -->  if (mouse.IsButtonDown(eMouseLeft))

   //Display("Mouse Mode:%d", mouse.Mode);
   Display("Click");


It works most of the time except when I get to my menus GUI's (that pause the game when opened). When Im in eModePointer, usually, when I click on the left mouse button I never see the "click" message, nor the other debug message (which gives me the current mouse mode)...I just get no display at all, although if I use the pointer mode in the normal gameplay screen, Ill ge those display messages no prob...

So obviously something in my menus are not letting me see those debug displays when I click on the left mouse button. I really dont know what though, I dont think I did anything different to those menus that would make AGS not able to tell me when the left mouse is being clicked. I noticed if I set the GUI menu flag "Clickable" to "0", it will display those debug messages...so I guess the menu GUI absorbs the click, but how come it wont display my messages?

PS: its not a eMouseLeftInv issue though, its really a leftmouse click issue.

How do I get those display debug messages for left-mouse clicks working like I want to when the mouse is over a clickable menu?
Title: Re: Mouse click debugging on menu GUI's is confusing for me :(
Post by: Khris on Mon 28/06/2010 16:44:58
if (mouse.IsButtonDown(eMouseLeft)) is rather to be used inside repeatedly_execute; inside on_mouse_click, you'd use if (button == eMouseLeft).

To catch clicks over GUIs, use eEventGUIMouseDown inside on_event.
Title: Re: Mouse click debugging on menu GUI's is confusing for me :(
Post by: Knox on Mon 28/06/2010 17:48:06
aaaaawww yeah, thats what Im talkin' 'bout! Nice, Ill look that up right away and get cracking.

Thanks Khris, always helpful :)