mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 03:23:42 +00:00
Add onStart parameter into scene.transition(config)
It can define transition action of scenes in a single scene.transition(config) call.
This commit is contained in:
parent
1abf11e4f9
commit
558589f851
2 changed files with 11 additions and 0 deletions
|
@ -334,6 +334,15 @@ var ScenePlugin = new Class({
|
|||
this.manager.start(key, GetFastValue(config, 'data'));
|
||||
}
|
||||
|
||||
var onStartCallback = GetFastValue(config, 'onStart', null);
|
||||
|
||||
var onStartScope = GetFastValue(config, 'onStartScope', this.scene);
|
||||
|
||||
if (onStartCallback)
|
||||
{
|
||||
onStartCallback.call(onStartScope, this.scene, target, duration);
|
||||
}
|
||||
|
||||
this.systems.events.emit(Events.TRANSITION_OUT, target, duration);
|
||||
|
||||
this.systems.events.on(Events.UPDATE, this.step, this);
|
||||
|
|
|
@ -11,5 +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 {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).
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue