JSFiddle - React, Tailwind, and code Playground

by Kanthi Siddhanthi

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.min.js"></script>

JavaScript

function initGame(){
	var game = new Phaser.Game(1024, 600, Phaser.AUTO, "", {preload: onGamePreload, create: onGameCreate});
}
initGame();

function onGameCreate(){

  var display = {
                    font: "36pt Arial",
                    fill: "#ffffff",
                    align: "center"
                };
                var text = new Phaser.Text(this.game, 0, 0, "This is a Text Object", display);
                this.game.add.existing(text);
}
function onGamePreload(){
	this.game.stage.backgroundColor = "#2e2e2e";
	this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
  this.game.scale.refresh();
}