Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: SilverSpook on Sat 02/05/2015 00:04:09

Title: Force "Top Of Screen" GUI Visible temporarily
Post by: SilverSpook on Sat 02/05/2015 00:04:09
I have a GUI at the top of the screen similar to the default AGS GUI  whose visibility is set to, "When mouse moves to top of the screen."

I want to have this GUI visible temporarily during an intro portion of the game while I'm explaining what the GUI buttons do. 

I tried setting the GUI's "Visible" parameter to true but it seems to stay invisible.  I tried setting the mouse cursor to the top of the screen, but the mouse.x and mouse.y are read-only, it says.

Is there a way to force this GUI to show for a bit?

Thanks
Title: Re: Force "Top Of Screen" GUI Visible temporarily
Post by: xil on Sat 02/05/2015 00:19:31
I'm certainly no expert but a quick hack could be to set the PopupYPos coordinate to the height of the resolution perhaps?
Title: Re: Force "Top Of Screen" GUI Visible temporarily
Post by: Mandle on Sat 02/05/2015 01:19:41
Quote from: xil on Sat 02/05/2015 00:19:31
I'm certainly no expert but a quick hack could be to set the PopupYPos coordinate to the height of the resolution perhaps?

That might do it. But I'm concerned that it might only make the menu appear if the player moves the mouse. I don't know for sure though.

I would probably just take a screenshot of the game with the GUI visible and use that to make a dummy GUI which looks exactly the same as the real one. Then make that visible during the tutorial instead of the actual one.

There's probably a better way though.
Title: Re: Force "Top Of Screen" GUI Visible temporarily
Post by: SilverSpook on Sat 02/05/2015 02:09:45
I did consider doing that, Mandle, although I figured there might be something simpler, and less likely to have issues if anything about the UI changes.  Thanks for the suggestion though.
Title: Re: Force "Top Of Screen" GUI Visible temporarily
Post by: Crimson Wizard on Sat 02/05/2015 03:01:22
Set visibility style to normal, and script the behavior yourself.

Simple example:
Code (ags) Select

function repeatedly_execute()
{
    if (!InTutorial)
    {
        if (gGui1.Visible && mouse.Y > 40)
            gGui1.Visible = false;
        else if (!gGui1.Visible && mouse.Y < 40)
            gGui1.Visible = true;
    }
}
Title: Re: Force "Top Of Screen" GUI Visible temporarily
Post by: Mandle on Sat 02/05/2015 04:39:06
See...I knew someone who knew what they are talking about would come along soon!

Cheers Crimson Wizard! I learned something today too!