Mostly fixed width issue, more responsive to width and changes. Tweaked border shadow

This commit is contained in:
Hayden Kroepfl 2018-01-01 11:00:00 -07:00
parent 71687cdc9f
commit 6152310c36
2 changed files with 23 additions and 12 deletions

View File

@ -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;
}

View File

@ -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.