From b1916a9d14ba9dba75b8d2356f76eee804a215ab Mon Sep 17 00:00:00 2001 From: Rex Date: Mon, 28 Feb 2022 22:44:18 +0800 Subject: [PATCH] Add typedef of onStart parameter --- src/scene/typedefs/SceneTransitionConfig.js | 2 +- src/scene/typedefs/SceneTransitionStartCallback.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/scene/typedefs/SceneTransitionStartCallback.js diff --git a/src/scene/typedefs/SceneTransitionConfig.js b/src/scene/typedefs/SceneTransitionConfig.js index 5e4d8cfc5..e5e159844 100644 --- a/src/scene/typedefs/SceneTransitionConfig.js +++ b/src/scene/typedefs/SceneTransitionConfig.js @@ -11,7 +11,7 @@ * @property {boolean} [moveBelow] - Move the target Scene to be below this one before the transition starts. * @property {function} [onUpdate] - This callback is invoked every frame for the duration of the transition. * @property {any} [onUpdateScope] - The context in which the callback is invoked. - * @property {function} [onStart] - This callback is invoked when transition starting. + * @property {Phaser.Types.Scenes.SceneTransitionStartCallback} [onStart] - This callback is invoked when transition starting. * @property {any} [onStartScope] - The context in which the callback is invoked. * @property {any} [data] - An object containing any data you wish to be passed to the target scene's init / create methods (if sleep is false) or to the target scene's wake event callback (if sleep is true). */ diff --git a/src/scene/typedefs/SceneTransitionStartCallback.js b/src/scene/typedefs/SceneTransitionStartCallback.js new file mode 100644 index 000000000..db6d93825 --- /dev/null +++ b/src/scene/typedefs/SceneTransitionStartCallback.js @@ -0,0 +1,9 @@ +/** + * @callback Phaser.Types.Scenes.SceneTransitionOnStartCallback + * @since 3.60.0 + * + * @this Phaser.Scene + * @param {Phaser.Scene} fromScene - Scene instance to transition from. + * @param {Phaser.Scene} toScene - Scene instance to transition to. + * @property {number} [duration=1000] - The duration, in ms, for the transition to last. + */