Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Technocrat on Sat 30/05/2009 16:34:24

Title: Objects underneath a GUI...
Post by: Technocrat on Sat 30/05/2009 16:34:24
Probably something deceptively simple, but it's just something I've run into. In order to control the game, I've got a GUI that spans the entirety of the 320x200 screen, and just realised that part of my plan of selecting the room objects underneath the GUI has been stopped by the GUI getting in the way, so "interacting" doesn't happen. Is there a means by which I can return which object is underneath the cursor, *behind* the GUI?

I'm unable to make the GUI smaller, because it's covered in labels all over the screen showing a value relating to each of the room objects underneath.
Title: Re: Objects underneath a GUI...
Post by: GarageGothic on Sat 30/05/2009 16:41:41
You can set the GUI's "Clickable" property to false, that will allow you to "click through" the GUI. If you have any parts of the GUI that need to be clickable, put those on a separate GUI.

If this isn't possible, you could turn off the GUI momentarily (in the eEventGUIMouseDown on_event for instance) to check for any objects at the cursor position, then turn it back on. As this would all happen within the same game loop, the player wouldn't see the GUI flickering on and off.
Title: Re: Objects underneath a GUI...
Post by: Technocrat on Sat 30/05/2009 16:49:20
Ah, brilliant! Thought it'd be disconcertingly straightforward. Cheers!