Basic Text Creation
Demonstrates the simplest way to add and display a text string at specific coordinates in a scene.
800 × 600
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);