Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Chicky on Tue 22/08/2006 15:22:49

Title: Help with popup GUI (SOLVED)
Post by: Chicky on Tue 22/08/2006 15:22:49
Howdy,

Monkey was helping me with some of the HTMI scripting untill 4am this morning and we made a good deal of progress.

But he's asleep now and i'm having a problem :P

See ive got this code

gIconbar.Visible = (mouse.y >= 180);

which is under repeatedly execute in my global script, its there to make the gui visible when the curser goes to the bottom of the screen. But i have two problems.

If i have used the gui off command to turn it off it still comes up when my curser heads to the bottom of the screen, i'm guessing because it's in repeatedly execute. How would i go by fixing this?

And also i want there to be a 2 second or so delay so the gui stays at the bottom after i move my mouse to the botton of the screen...

So basicly, the GUI takes up about 25% of the bottom of the screen, but the hotspot to make the gui popup only takes 10% or so. What i want is after the gui has popped up i want it to stay there for 2 seconds or so, so that the user can click the buttons at the top of the GUI.

Sorry if this doesn't make much sense but I'm tired and rambling.

thanks in advance.
Title: Re: Help with popup GUI.
Post by: monkey0506 on Tue 22/08/2006 16:18:24
So Nathan, if I understand you correctly, what you want is, any time you move the mouse to the bottom of the screen, the GUI is on for at least two seconds, but longer if the mouse stays at the bottom of the screen?

Or maybe it should be that if the mouse is over the GUI it should stay on during that time until the mouse moves off the GUI?

And...what code did you use to turn it off...or was it the interaction editor? You could set a variable to determine if it should be able to come on or not...just let me know what it is you have done and how you want it to work.
Title: Re: Help with popup GUI.
Post by: SSH on Tue 22/08/2006 16:31:01
Quote from: Chicky on Tue 22/08/2006 15:22:49
gIconbar.Visible = (mouse.y >= 180);

Just chaneg this to:


gIconbar.Visible = (mouse.y >= 180) || GUI.GetAtScreenXY(mouse.x, mouse.y)==gIconbar;

Title: Re: Help with popup GUI.
Post by: Chicky on Tue 22/08/2006 16:42:03
Wow, awesome. That worked! Thanks!

Now how do i prevent the gui from coming up hen im on the menu screen?
Title: Re: Help with popup GUI.
Post by: SSH on Tue 22/08/2006 16:43:58

  gIconbar.Visible = (player.Room != ROOM_NUMBER_OF_MENU_SCREEN) && ((mouse.y >= 180) || GUI.GetAtScreenXY(mouse.x, mouse.y)==gIconbar);
Title: Re: Help with popup GUI.
Post by: Chicky on Tue 22/08/2006 17:20:35
Ace, thankyou very much.
Title: Re: Help with popup GUI.
Post by: monkey0506 on Tue 22/08/2006 17:34:08
You know Nathan, if you would answer me on MSN I could have told you that...-.-

Letting SSH step in on my work...pshhh...

:=
Title: Re: Help with popup GUI.
Post by: SSH on Tue 22/08/2006 17:41:44
I'm faster than a speeding monkey...