Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 22/02/2004 20:56:04

Title: GUI bar with Mouse-Y pos visibility won't stay visible
Post by: on Sun 22/02/2004 20:56:04
Hi, I'm new to AGS and I'm having a tiny little problem with making my own GUI. I made a GUI bar which contains the inventory as well as two buttons to scroll the inventory and a third button to display the game menu. Tthe bar is set to disappear whenever its not needed (Visibility = mouse-y pos). This all works fine, however, when I click the buttons to scroll the inventory, the gui bar disappears until i move my mouse cursor into the "hot area" again. Now I undestand that in most cases this behaviour makes a lot of sense, but in my case I would the bar to stay visible when clicking on the scroll-buttons.
Can anyone tell me if/how this can be achieved? Any help would be much appreciated!
Title: Re:GUI bar with Mouse-Y pos visibility won't stay visible
Post by: Scorpiorus on Sun 22/02/2004 21:52:47
In that case you need to handle mouse-y thing in script.
First set the GUI visible property to popup modal.

Next, put the following into the main global script:

function repeatedly_execute() {

int gui = GUI_NAME_HERE;
int offsetY = 15;

if (IsGUIOn(gui)) {
if (GetGUIAt(mouse.x, mouse.y)!=gui) GUIOff(gui);
} else if (mouse.y < offsetY) GUIOn(gui);

}
Title: Re:GUI bar with Mouse-Y pos visibility won't stay visible
Post by: on Sun 22/02/2004 23:20:26
woah, that was fast. Thanks a bunch, works marvelously!