Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Brian925 on Tue 03/01/2023 09:18:21

Title: GUI interaction on mouse over
Post by: Brian925 on Tue 03/01/2023 09:18:21
Hello,

I have a top bar GUI that appears only when the cursor is at the top of the screen.

 Is there a simple way for a different GUI to be closed upon this action?(when the top bar is revealed).I'm having trouble because the top bar isn't simply visible or not visible, it's dependent on mouse placement.

In a perfect world I'd roll over the top bar to reveal it (gInvbar), and that would close a different GUI.(gRaiseArrow)

Any help is appreciated. Thanks.
Title: Re: GUI interaction on mouse over
Post by: Khris on Tue 03/01/2023 12:16:12
Open GlobalScript.asc and find/add this:
function repeatedly_execute_always()
{
...
}

Put this inside:
  if (gInvbar.Visible && gRaiseArrow.Visible) gRaiseArrow.Visible = false;
Title: Re: GUI interaction on mouse over
Post by: eri0o on Tue 03/01/2023 13:27:29
@Brian925 you can disable that behavior from the top bar by looking into the GUI properties, it has a specific setting there (I forgot the name) that does this behavior. You can disable that and handle it through script, so you would have full control.
Title: Re: GUI interaction on mouse over
Post by: Brian925 on Tue 03/01/2023 19:32:30
Thanks guys.
Khris, worked fine, appreciate it.
eri0o, I actually like the function, gives the option to have a tool bar without constantly taking up space, I just have one exception that I was trying to cover.