JSFiddle - React, Tailwind, and code Playground
by espace3d
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.1/phaser.min.js"></script>
JavaScript
var innerWidth =window.innerWidth
var innerHeight=window.innerHeight
var gameRatio =innerWidth/innerHeight
var game = new Phaser.Game(640,Math.ceil(640*gameRatio), Phaser.CANVAS, '', { preload: preload, create: create, update: update })
function preload() {
game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL
// game.scale.setScreenSize(true)
game.scale.pageAlignHorizontally = true
game.scale.pageAlignVertically = true
game.load.image("test","https://s21.postimg.org/ohfa30zhj/test.jpg")
}
function create(){
var ech=game.add.sprite(0,0,'test')
//resize()
}
function update(){}