Headless Renderer
Configure the game to use the Phaser.HEADLESS renderer type, allowing the game loop and logic to run without rendering any visual output to the screen.
800 × 600
class Example extends Phaser.Scene
{
preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
this.load.image('pic', 'assets/pics/baal-loader.png');
}
create ()
{
const pic = this.add.image(400, 300, 'pic');
this.tweens.add({
targets: pic,
angle: 360,
repeat: -1
});
}
}
const config = {
scale: { mode: Phaser.Scale.FIT },
type: Phaser.HEADLESS,
parent: 'game-container',
width: 800,
height: 600,
scene: Example
};
const game = new Phaser.Game(config);