JSFiddle - React, Tailwind, and code Playground
by shiqangpan
HTML
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.js"></script>
JavaScript
class BootScene extends Phaser.Scene {
constructor() {
super();
console.log(this);
}
create() {
this.add.dom(200, 200, 'div',
'background: cornflowerblue; width: 100px; height: 100px; font: 48px Arial', 'Phaser');
}
}
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
dom: {
createContainer: true
},
backgroundColor: 0x000000,
scene: [BootScene]
}
var game = new Phaser.Game(config);