Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Rik_Vargard on Thu 28/03/2024 14:05:54

Title: [SOLVED] Having the object animations continue (not pause) when opening a GUI
Post by: Rik_Vargard on Thu 28/03/2024 14:05:54
Hello,

So that's the thing I can't solve right now:
When opening a GUI, all the object animations pause, and I don't want that.
What can I do so the object animations continue even when I open a GUI?
Pop-up Style is > When mouse moves to top of screen

Thx!
Title: Re: Having the object animations continue (not pause) when opening a GUI
Post by: Khris on Thu 28/03/2024 15:19:57
Afaik the GUI's visibility is what determines whether the game pauses; you have to switch it to normal and implement the PopUp behavior yourself.

Like this:
  // inside repeatedly_execute:
  if (!gTopbar.Visible && mouse.y < 10) gTopbar.Visible = true;
  else if (gTopbar.Visible && mouse.y >= gTopbar.Height) gTopbar.Visible = false;

This should also work:
  // inside repeatedly_execute:
  GUI* g = gTopbar; // set GUI
  g.Visible = mouse.y < 10 || g.Visible && mouse.y < g.Height;
Title: Re: Having the object animations continue (not pause) when opening a GUI
Post by: eri0o on Thu 28/03/2024 15:54:41
Afaik it's separately but the name of the property is PopUp Style, I think it's set to "Pause game when shown" and instead you should just configure it to "Normal".

I think if you want the pause but want some animation you can also instead manually handle the animation in repeatedly_execute_always
Title: Re: Having the object animations continue (not pause) when opening a GUI
Post by: Crimson Wizard on Thu 28/03/2024 16:06:49
I do not remember if this is documented, but "When mouse moves to top of screen" style actually pauses the game, similar to "Pause game when shown". This is a hardcoded behavior.

So, the solution is to set it to "Normal" and script popup yourself, as Khris posted above.
Title: Re: Having the object animations continue (not pause) when opening a GUI
Post by: Rik_Vargard on Thu 28/03/2024 18:15:15
OK, it works perfectly!

Thank you very much for the help and explanations  (nod)

Cheers!