Pause Music/Sounds When Game is Out of Focus

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,442
Reaction score
679
First Language
Polish
Primarily Uses
Other
When the game loses focus either by minimalizing or clicking outside the window, the game pauses itself, but the BGM/BGS still plays.


Is it possible to pause at least BGM when game is out of focus and unpause when getting back to the game? 


Or make it not pause anything at all ~ game running even in background.


~Thanks!
 
Last edited by a moderator:

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,695
Reaction score
928
First Language
English
Primarily Uses
N/A
For ace, no. Code execution is stopped when the game is out of focus, so there's really nothing that can be done about it. At least in MV neither updating nor music was paused by default, so it was possible to create a plugin that paused either or both.
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,442
Reaction score
679
First Language
Polish
Primarily Uses
Other
Aww another silly limit.


Literally, Ace is blocking so many possibilities. . . =/


(Music-synced minigames - impossibru)


That's what I get for thinking about doing non-RPG things in RPG focused software...


(I guess RM is not for me =P)


Welp, thank you for clarifying. (=
 
Last edited by a moderator:

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,442
Reaction score
679
First Language
Polish
Primarily Uses
Other
I think I've got an idea


What would probably solve that problem, would be getting the real time.


I know it is possible to get the current real time using methods in Time class, but how accurate they are?


I'd need it pretty accurate ~


Something like:


08:31:34'25/60


HOUR   |    MIN    |   SEC | 1/60 sec (60 FPS - I need to get each frame)


                                              (or even 1/100 or 1/1000 ~ I could make some maths to convert that)


Having just


08:31:34


HOUR |  MIN  | SEC


is possible I think, but that way it wouldn't be accurate as one second holds 60 frames and that could cause de-sync.


That would allow me to implement 'Frame Skip' so even a lag would not cause de-syncs!


How accurate time can I get?


I need to take a look on Time Class...
 
Last edited by a moderator:

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,442
Reaction score
679
First Language
Polish
Primarily Uses
Other
I just found out, that if you'll minimalize Ace by clicking its icon on the task bar - the game is still running ~ it's even updating the input ~ and all of this, when I have a different window active.


For example, while I'm typing this - the game still runs and I can hear the stuff I'm clicking there, even when I don't even see it.


So... What kind of sorcery is this? Perhaps it could be possible to do this when doing other things like clicking outside the window? How does that work?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Are there any vocalists on RPG Maker Forums that would want to sing together in a group, duet or make a whole channel together?
Here it is in all its leggy glory! I apologize in advance.
Suggestion for the name for the new RM, RPG Maker Re-MV (Re-Mastered Version)
A guide on Furry Potatoes.

Forum statistics

Threads
98,176
Messages
950,099
Members
129,474
Latest member
jacktarma
Top