Creating a "5 Days a Stranger" style GUI.

Started by , Mon 23/08/2004 04:53:00

Previous topic - Next topic

Steven Edward

This is the first time I've had to ask a question since I started using AGS in March of this year. I'm sorry to repeat a question if it's been answered.

What I want to do is make a GUI menu that pops up when the user clicks the right mouse button, and then disapears when the mouse is moved off the GUI. Basically what was used for '5 Days.' I don't need an explanation of how to create the actual GUI items. What I could use some help with is the code that I could use to accomplish this technique.

Your help is GREATLY appreciated and I look forward to any replies you can offer.Ã,  ;)

- Steve

Rui 'Trovatore' Pires

Well, I have a tendency to complicate stuff, so there's probably a better way, but -

To summon it with right-click, at the on_mouse_click function you replace the stantard SetNextMode with GUIOn(whatever).  But some extra code will be needed to make sure the GUI isn't offscreen if the mouse is too close to an edge, and out of the top of my head I can't help you.

To make it go away, have a line like this in repeatedly_execute -

if (IsGUIOn(whatever) && GetGUIAt(mouse.x, mouse.y)!=whatever) GUIOff(whatever)
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SilverWizard_OTF

You can also use the script command CentreGui( //your Gui);  if you to be revealed in the centre o the screen, the desired Gui.
"All we have to decide is what to do, with the time that is given to us"

Rui 'Trovatore' Pires

But of course, then you'd have to set the mouse's coordinates manually so it'd show up at the center of the screen.

I don't think that's the best solution, and neither it is what he's looking for, SilverWizard.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SilverWizard_OTF

"All we have to decide is what to do, with the time that is given to us"

SMF spam blocked by CleanTalk