Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Resource09 on Thu 10/10/2019 23:59:14

Title: Not allow to show some GUIs in a specific room
Post by: Resource09 on Thu 10/10/2019 23:59:14
Hello,
I have this problem: I have some GUIs like inventory, save and load GUIs and a general panel that appear when pressed specific keys (ESC, TAB, F5).
I want to disable the keypress in some specific room, for example in title screen, and allow them again when the game starts.
Someone know the solution?

Thank you
Title: Re: Not allow to show some GUIs in a specific room
Post by: Cassiebsg on Fri 11/10/2019 00:47:22
You can add and if to the on_keypress function.

like

Code (ags) Select

function on_key_press(eKeyCode keycode)
{
  if (keycode == eKeySpace)
  {
    if (player.Room==1) return; // as in, do nothing.
    else // add the keycode her.
  }
}
Title: Re: Not allow to show some GUIs in a specific room
Post by: Resource09 on Fri 11/10/2019 17:42:08
It works!

Thanx!!!