I have a Scene in which I call my UI, and display a sprite.
MainGame.js
export default class MainGame extends Phaser.Scene
{
constructor ()
{
super('MainGame');
this.sprite;
}
create {
this.scene.launch('UI');
this.sprite = this.add.sprite(0, 45, 'mysprite');
this.sprite.anims.play({key: 'idle'}, true);
}
}
In my UI.js I have:
export default class UI extends Phaser.Scene
{
constructor ()
{
super({key: 'UI'});
}
init ()
{
this.scene.moveUp();
}
create ()
{
//
}
}
Yet my UI (health bar etc..) is below anything I put on the Scene of MainGame.js