Skip to content

Pause Overlay Utilities

This module provides utility functions to manage the visibility of the pause overlay and loading screen in a web-based game.

Functions

htmlShowPauseOverlay(): void

Displays the game pause overlay.

Usage

htmlShowPauseOverlay();

htmlHidePauseOverlay(): void

Hides the game pause overlay.

Usage

htmlHidePauseOverlay();

htmlHideLoadingScreen(): void

Hides the game’s loading screen after initialization is complete.

Usage

htmlHideLoadingScreen();

Internal Helper Functions

getPauseOverlay(): HTMLElement

Retrieves the pause overlay element from the DOM. Throws an error if the element is not found.

Usage

This function is used internally by htmlShowPauseOverlay and htmlHidePauseOverlay.

const pauseOverlay = getPauseOverlay();