Objects underneath a GUI...

Started by Technocrat, Sat 30/05/2009 16:34:24

Previous topic - Next topic

Technocrat

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.

GarageGothic

#1
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.

Technocrat

Ah, brilliant! Thought it'd be disconcertingly straightforward. Cheers!

SMF spam blocked by CleanTalk