* pause the current stage * @param [music=false] - pause current music track on screen pause
(music: boolean = false)
| 330 | * @param [music=false] - pause current music track on screen pause |
| 331 | */ |
| 332 | pause(music: boolean = false): void { |
| 333 | // only pause when we are not loading stuff |
| 334 | if (_state !== this.LOADING && !this.isPaused()) { |
| 335 | // stop the main loop |
| 336 | _pauseRunLoop(); |
| 337 | // current music stop |
| 338 | if (music) { |
| 339 | pauseTrack(); |
| 340 | } |
| 341 | |
| 342 | // store time when paused |
| 343 | _pauseTime = globalThis.performance.now(); |
| 344 | |
| 345 | // publish the pause event |
| 346 | emit(STATE_PAUSE); |
| 347 | } |
| 348 | }, |
| 349 | |
| 350 | /** |
| 351 | * Restart the current stage from a full stop. |
nothing calls this directly
no test coverage detected