You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoke the following method: ScenePlugin.moveBelow(keyA, keyB)
Expected
Scene Order should be retained. [SceneA, SceneB]
Actual
Scenes are swapped even though SceneB is already below SceneA. [SceneB, SceneA]
Example Test Code
class Controller extends Phaser.Scene {
constructor ()
{
super({ key: 'Controller', active: true });
}
create ()
{
this.input.on('pointerdown', function (pointer) {
this.scene.moveBelow('SceneA', 'SceneB');
}, this);
}
}
class SceneA extends Phaser.Scene {
constructor ()
{
super({ key: 'SceneA', active: true });
}
create ()
{
this.add.rectangle(340, 300, 64, 64, 0xff33cc);
}
}
class SceneB extends Phaser.Scene {
constructor ()
{
super({ key: 'SceneB', active: true });
}
create ()
{
this.add.rectangle(380, 300, 64, 64, 0xbbb3cc);
}
}
let config = {
type: Phaser.AUTO,
width: 800,
height: 600,
parent: 'phaser-example',
scene: [ Controller, SceneA, SceneB ]
// When left mouse is clicked, SceneA and SceneB will be swapped regardless of the order
};
let game = new Phaser.Game(config);
Additional Information
Solution
I think we would just need to check that the index of the first parameter of the method (keyA) is greater than the index of the second parameter (keyB).
I'm assuming the same issue might occur with the moveAbove as well.
The text was updated successfully, but these errors were encountered:
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
Version
Description
Scene Order
[SceneA, SceneB]
Invoke the following method:
ScenePlugin.moveBelow(keyA, keyB)
Expected
Scene Order should be retained. [SceneA, SceneB]
Actual
Scenes are swapped even though SceneB is already below SceneA. [SceneB, SceneA]
Example Test Code
Additional Information
Solution
I think we would just need to check that the index of the first parameter of the method (keyA) is greater than the index of the second parameter (keyB).
I'm assuming the same issue might occur with the moveAbove as well.
The text was updated successfully, but these errors were encountered: