Topic was automatically imported from the old Question2Answer platform.
Asked By
cmdrsteel
How would I get a game to pause when changing the current running app from godot to something else such as the home screen on the iphone? Is it also similar with andriod?
On any OS, you can use both NOTIFICATION_WM_FOCUS_IN and NOTIFICATION_WM_FOCUS_OUT.
Example:
func _notification(what):
match what:
MainLoop.NOTIFICATION_WM_FOCUS_OUT:
pass # Pause the game
MainLoop.NOTIFICATION_WM_FOCUS_IN:
pass # Continue game