[SOLVED] Having the object animations continue (not pause) when opening a GUI

Started by Rik_Vargard, Thu 28/03/2024 14:05:54

Previous topic - Next topic

Rik_Vargard

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!

Khris

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:
Code: ags
  // 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:
Code: ags
  // inside repeatedly_execute:
  GUI* g = gTopbar; // set GUI
  g.Visible = mouse.y < 10 || g.Visible && mouse.y < g.Height;

eri0o

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

Crimson Wizard

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.

Rik_Vargard

OK, it works perfectly!

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

Cheers!

SMF spam blocked by CleanTalk