Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
and then
instance_reactivate_all();
when I'm done with the pausing.
If you want the screen to remain unchanged you can take a snaphot of it as a surface and display that surface as a sprite (but I've never done this 'cos i'm only learning surfaces now for the first time).
An alternative to Bruford's solution would be to disable the drawing of a background color and any other nackground objects on top of deactivating everything; as I recall, that should stop the room from having anything to redraw and thus just leave the canvas as it was when you left it until you change things back, but tileset layers could complicate this so the stated method might be one of the more solid ways to approach this.
Another thing I've looked into was having a global Pause variable and start every bit of applicable code with a check to make sure the game should be running, but this renders GM's built in alarms, timelines and to a lesser extent paths a fair bit useless, so use that with caution as well.
(Something like
var future_time = current_time + 1000; while current_time < future_time {}
but using system time.)
All I want is a delay between events. I do appreciate the suggestions, though. I'm just surprised nothing more straightforward is built in. apparently it was in 8 and earlier...
In your pause event/trigger:
instance_deactivate_all(true) // The true here is whether the object it is attached to should be excluded from deactivation. If it is true it will stay active, if it is false it will be deactivated.
alarm [ 0 ] = ? // (However long you want it to pause in frames. If your room speed is 30, 1 second is 30 frames)
in the Alarm [ 0 ] event:
instance_reactivate_all();
Sleep was removed because it forced the runner to freeze and become unresponsive.
I know it's lame but it works.