Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: magintz on Wed 05/10/2005 19:45:34

Title: Hide GUI and show when key pressed [SOLVED]
Post by: magintz on Wed 05/10/2005 19:45:34
Has anyone got any pointers how I can hide the GUI and make it appear when a key is pressed. The only thing that comes to mind is if any key is pressed, that key is stored into a variable, the GUI turns on and then that variable is placed in the textbox. This would work, but how would I have an "if any key A-Z is pressed"?
Title: Hide GUI and show when key pressed
Post by: monkey0506 on Wed 05/10/2005 20:26:25
// main global script
int timer = 0;

// on_key_press
if ((keycode >= 65) && (keycode <= 90)) {
  gParsergui.Visible = true;
  /* set text on GUI...something like
  Parsertextbox.Text = String.Format("%s%c", Parsertextbox.Text, keycode);
  perhaps? */
  timer = 10 * GetGameSpeed(); /* wait 10 seconds */
  }

// rep_ex
if (timer > 0) timer--;
else gParsergui.Visible = false;


I hope you will find this useful. ;)

Unlike my previous attempt, in which I made a complete fool outta myself. :=
Title: Hide GUI and show when key pressed
Post by: magintz on Fri 07/10/2005 15:53:09
thanks, works a treat