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 { .container {
width: 1600px; width: 100%;
} }
#game { #game {
box-shadow: rgba(46, 94, 134, 0.45) 10px 10px 3px; box-shadow: rgba(46, 94, 80, 0.45) 0ex 0ex 2ex;
margin-top: 1em; /*margin-top: 1em;*/
outline: none; outline: none;
width: 100%;
margin: 1em 0 1em 1em;
box-sizing: border-box;
/*background: #282828;*/ /*background: #282828;*/
} }
#editor { #editor {
margin-top: 1em; margin: 1em 0 1em 1em;
height: 650px; height: 30em;
box-shadow: rgba(46, 94, 134, 0.45) 10px 10px 3px; box-shadow: rgba(46, 94, 80, 0.45) 0ex 0ex 2ex;
} }

View File

@ -48,11 +48,11 @@ LOW_ENERGY = 100;
if (fullscreen) { if (fullscreen) {
RENDERER_WIDTH = window.innerWidth - 4; RENDERER_WIDTH = window.innerWidth* window.devicePixelRatio - 4;
RENDERER_HEIGHT = window.innerHeight - 4; RENDERER_HEIGHT = window.innerHeight* window.devicePixelRatio - 4;
} else { } else {
RENDERER_WIDTH = document.getElementById("game").clientWidth; RENDERER_WIDTH = document.getElementById("game").clientWidth * window.devicePixelRatio;
RENDERER_HEIGHT = (window.innerHeight / 1.25); RENDERER_HEIGHT = (window.innerHeight / 1.40) * window.devicePixelRatio;
} }
var game = new Phaser.Game(RENDERER_WIDTH, RENDERER_HEIGHT, Phaser.AUTO, 'game', null, true, false); var game = new Phaser.Game(RENDERER_WIDTH, RENDERER_HEIGHT, Phaser.AUTO, 'game', null, true, false);
@ -1113,6 +1113,9 @@ BasicGame.Boot.prototype = {
game.camera.y = 90; game.camera.y = 90;
game.stage.disableVisibilityChange = true; game.stage.disableVisibilityChange = true;
this.scale.scaleMode = Phaser.ScaleManager.RESIZE;
this.scale.pageAlignHorizontally = true;
this.scale.pageAlignVertically = true;
}, },
create: function () { create: function () {
@ -1134,6 +1137,8 @@ BasicGame.Boot.prototype = {
}, },
update: function () { update: function () {
game.scale.setShowAll();
game.scale.refresh();
// Update the cursor position. // 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 // 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. // determined from the 2D pointer position without extra trickery. By default, the z position is 0 if not set.