From 6152310c365c0912e5e56c20933589c8bda35706 Mon Sep 17 00:00:00 2001 From: Hayden Kroepfl Date: Mon, 1 Jan 2018 11:00:00 -0700 Subject: [PATCH] Mostly fixed width issue, more responsive to width and changes. Tweaked border shadow --- mar/game.css | 18 ++++++++++++------ mar/phaser/mar.js | 17 +++++++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/mar/game.css b/mar/game.css index 88bd1f3..14eebe9 100755 --- a/mar/game.css +++ b/mar/game.css @@ -5,20 +5,26 @@ } .container { - width: 1600px; + width: 100%; + + } #game { - box-shadow: rgba(46, 94, 134, 0.45) 10px 10px 3px; - margin-top: 1em; + box-shadow: rgba(46, 94, 80, 0.45) 0ex 0ex 2ex; + /*margin-top: 1em;*/ outline: none; + width: 100%; + margin: 1em 0 1em 1em; + box-sizing: border-box; + /*background: #282828;*/ } #editor { - margin-top: 1em; - height: 650px; - box-shadow: rgba(46, 94, 134, 0.45) 10px 10px 3px; + margin: 1em 0 1em 1em; + height: 30em; + box-shadow: rgba(46, 94, 80, 0.45) 0ex 0ex 2ex; } diff --git a/mar/phaser/mar.js b/mar/phaser/mar.js index 872acce..6260ac4 100644 --- a/mar/phaser/mar.js +++ b/mar/phaser/mar.js @@ -48,11 +48,11 @@ LOW_ENERGY = 100; if (fullscreen) { - RENDERER_WIDTH = window.innerWidth - 4; - RENDERER_HEIGHT = window.innerHeight - 4; + RENDERER_WIDTH = window.innerWidth* window.devicePixelRatio - 4; + RENDERER_HEIGHT = window.innerHeight* window.devicePixelRatio - 4; } else { - RENDERER_WIDTH = document.getElementById("game").clientWidth; - RENDERER_HEIGHT = (window.innerHeight / 1.25); + RENDERER_WIDTH = document.getElementById("game").clientWidth * window.devicePixelRatio; + RENDERER_HEIGHT = (window.innerHeight / 1.40) * window.devicePixelRatio; } var game = new Phaser.Game(RENDERER_WIDTH, RENDERER_HEIGHT, Phaser.AUTO, 'game', null, true, false); @@ -1112,8 +1112,11 @@ BasicGame.Boot.prototype = { game.camera.x = 280; game.camera.y = 90; game.stage.disableVisibilityChange = true; - - + + this.scale.scaleMode = Phaser.ScaleManager.RESIZE; + this.scale.pageAlignHorizontally = true; + this.scale.pageAlignVertically = true; + }, create: function () { @@ -1134,6 +1137,8 @@ BasicGame.Boot.prototype = { }, update: function () { + game.scale.setShowAll(); + game.scale.refresh(); // Update the cursor position. // It's important to understand that screen-to-isometric projection means you have to specify a z position manually, as this cannot be easily // determined from the 2D pointer position without extra trickery. By default, the z position is 0 if not set.