Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: left on Sun 19/12/2004 14:50:23

Title: is there mouse hold left click function?
Post by: left on Sun 19/12/2004 14:50:23
hello, i hope this in the right place.

i want to create an interface similar to that of Lucas arts game "Full throttle". In which if you left click on anything you walk to that spot but if you hold lift click down over an object it comes up with
a GUI with the options for that object e.g. use, look etc. I have figured out how to hae the GUI come up at the mouse co-ordinates but i can't figure out the rest.

thanks in advance  :)
Title: Re: is there mouse hold left click function?
Post by: Ishmael on Sun 19/12/2004 14:56:34
For first aid:

if (IsButtonDown(LEFT) == 1) {
Title: Re: is there mouse hold left click function?
Post by: Radiant on Sun 19/12/2004 16:28:58
In execute_always, put something like this:


/// put 'int holddown = 0;' at the top of your global script file
if (IsButtonDown (LEFT) && IsGUIOn (THINGY) == 0) {
   holddown ++;
   if (holddown >= 40) {
        holddown = 0;
       GUIOn (THINGY);
        // set GUI position to mouse pos
    }
}