Basic Text Creation

Demonstrates the simplest way to add and display a text string at specific coordinates in a scene.

Basic Text Creation, running
800 × 600
GitHub
class Example extends Phaser.Scene
{
    create ()
    {
        const t = this.add.text(100, 100, 'Phaser');

        console.log(t);
    }
}

const config = {
    scale: { mode: Phaser.Scale.FIT },
    type: Phaser.CANVAS,
    width: 800,
    height: 600,
    parent: 'game-container',
    scene: Example
};

const game = new Phaser.Game(config);

More in Text29 examples