Suggestion: Click through transparent parts of GUI

Started by Alynn, Sun 06/11/2005 03:05:12

Previous topic - Next topic

Alynn

Getting reaquainted with AGS, I made myself a GUI which has the mode button bar on bottom, and the inventory on the left side, and to make it nice and pretty put a border around the area where the action takes place. This gui is full screen.

Well because my GUI is clickable, I can't interact with the hotspots that are under it, even though the GUI is designed to have the viewable part of the room visable.

There are 2 work arounds, one which won't work for what I need, which is to change the clickablity in repeat_ex depending on the xy coords of the mouse. However due to how I have things set up, that doesn't work because if you can move the view downwards, when you move the mouse over that part it changes the mode from what you want to the move down mode...

The second is more obvious and that is to make 4 seperate GUI's.

The second one will work better than my first work around, however, it really seems pointless to create 4 gui's when I only really need one. And thus my suggestion.

Would it be possible to let something like a mask to be imported to create a "clickable area" for a gui, or something similar.

edmundito

I think because you're making a very special sort of gui that the best option would be to just have separate GUIs internally so that you can define what's clickable and what isn't.

But be sure to remember that your GUI should not take over the game. It should be easy to use and help the player have fun, not just to make it look cool...

Rui 'Trovatore' Pires

Oh, that one's not that big of a problem. :) I've met that scenario before. What you do is, have you entire GUI clickable as normal. Then, on the GUI's "On_Click" thingy, you put stuff like,

if ((the mouse.x is smaller than screenwidth minus the rightmost border and bigger than the thickness of the leftmost border) and (the mouse.y is smaller than screenheight minus the bottom border and is bigger than the height of the top border)) ProcessClick(mouse.x,mouse.y,mouse.Mode)

The thing is, "ProcessClick" IGNORES GUIs, so basically when the mouse is inside the transparent area it clicks through it.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

Something similar for GUI buttons has been requested here:
http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=513

and that could be extended to GUIs themselves, good idea.


SMF spam blocked by CleanTalk