Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: alimpo83 on Sun 24/09/2006 14:41:52

Title: Overlay
Post by: alimpo83 on Sun 24/09/2006 14:41:52
I need to have a overlay in the screen until you press a key or left mouse button. I've managed to make a timed overlay, but I need to replace the wait command with a key press, right? Can you help me?

This is my script, with the wait command:

int over1;
over1 = CreateGraphicOverlay(0,0,45,1);
Wait(200);
RemoveOverlay(over1);

Thanks.

Title: Re: Overlay
Post by: Ashen on Sun 24/09/2006 16:25:44
Firstly, what version of AGS are you using? As of 2.7, the way Overlays work has changed, and you'll want to use Overlay.CreateGraphical (http://www.adventuregamestudio.co.uk/manual/Overlay.CreateGraphical.htm) instead. (The old style still works, as long as you don't check the 'Enforce object-based scripting' option, but you should probably update anyway.)

Secondly, have you tried reading the manual? WaitMouseKey() (http://www.adventuregamestudio.co.uk/manual/WaitMouseKey.htm) might be what you want.
Title: Re: Overlay
Post by: alimpo83 on Sun 24/09/2006 17:15:55
Thanks, it works and I've updated the script for the new command type. ;D