Game onPause method

onPause(callback: () => void): void;

Subscribes to pause events.

Examples => {
  // Display pause screen.


  • Your game must pause all execution when callback is called and must resume execution only when the callback for onResume is called. This applies to all game behaviors including: the game loop, sounds, music, interactions, network calls, and rendering.
  • Your game must not use the Page Visibility API or similar APIs and must only use these GameSnacks SDK methods.
  • Your game should save user progress when callback is called.
  • Your game must clearly communicate to the user if it's paused.