Scene Add
Demonstrates how to manually add and automatically start a Scene class using the Scene Manager after the game instance has been created.
800 × 600
class Example extends Phaser.Scene
{
preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
this.load.image('face', 'assets/pics/bw-face.png');
}
create ()
{
this.add.image(400, 300, 'face');
}
}
const config = {
scale: { mode: Phaser.Scale.FIT },
type: Phaser.CANVAS,
parent: 'game-container',
width: 800,
height: 600
};
const game = new Phaser.Game(config);
// Scene add
game.scene.add('Boot', Example, true);