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
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)
You can also use the script command CentreGui( //your Gui); if you to be revealed in the centre o the screen, the desired Gui.
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.
Well, i only said my opinion...