GUI bar with Mouse-Y pos visibility won't stay visible

Started by Harry Hunt, Sun 22/02/2004 20:56:04

Previous topic - Next topic

Harry Hunt

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!

Scorpiorus

#1
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);

}

Harry Hunt

woah, that was fast. Thanks a bunch, works marvelously!

SMF spam blocked by CleanTalk