Skip to content

Commit 0d1e0f2

Browse files
committed
Add isPaused() methods to ScenePlugin, SceneManager
1 parent 0b2658c commit 0d1e0f2

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

src/scene/SceneManager.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,28 @@ var SceneManager = new Class({
911911
return null;
912912
},
913913

914+
/**
915+
* Determines whether a Scene is paused.
916+
*
917+
* @method Phaser.Scenes.SceneManager#isPaused
918+
* @since 3.17.0
919+
*
920+
* @param {string} key - The Scene to check.
921+
*
922+
* @return {boolean} Whether the Scene is paused.
923+
*/
924+
isPaused: function (key)
925+
{
926+
var scene = this.getScene(key);
927+
928+
if (scene)
929+
{
930+
return scene.sys.isPaused();
931+
}
932+
933+
return null;
934+
},
935+
914936
/**
915937
* Determines whether a Scene is visible.
916938
*

src/scene/ScenePlugin.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,23 @@ var ScenePlugin = new Class({
693693
return this.manager.isActive(key);
694694
},
695695

696+
/**
697+
* Checks if the given Scene is paused or not?
698+
*
699+
* @method Phaser.Scenes.ScenePlugin#isPaused
700+
* @since 3.17.0
701+
*
702+
* @param {string} [key] - The Scene to check.
703+
*
704+
* @return {boolean} Whether the Scene is paused.
705+
*/
706+
isPaused: function (key)
707+
{
708+
if (key === undefined) { key = this.key; }
709+
710+
return this.manager.isPaused(key);
711+
},
712+
696713
/**
697714
* Checks if the given Scene is visible or not?
698715
*

0 commit comments

Comments
 (0)