Testing difference between w/h and scale

This commit is contained in:
Richard Davey 2019-01-10 00:16:06 +00:00
parent 6d80772faf
commit aec555705f

View file

@ -174,7 +174,9 @@ var ScaleManager = new Class({
this.scaleMode = scaleMode; this.scaleMode = scaleMode;
// The un-modified game size, as requested in the game config. // The un-modified game size, as requested in the game config.
this.gameSize.setSize(width, height); this.gameSize.setSize(width * resolution, height * resolution);
// this.gameSize.setSize((width * zoom) * resolution, (height * zoom) * resolution);
// if (scaleMode < 5) // if (scaleMode < 5)
// { // {
@ -191,11 +193,13 @@ var ScaleManager = new Class({
this.canvasSize.setMax(config.maxWidth * zoom, config.maxHeight * zoom); this.canvasSize.setMax(config.maxWidth * zoom, config.maxHeight * zoom);
} }
console.log('set canvas size', width, height); // console.log('set canvas size', width, height);
this.canvasSize.setSize((width * zoom) * resolution, (height * zoom) * resolution); this.canvasSize.setSize(width * zoom, height * zoom);
console.log(this.canvasSize.toString()); // this.canvasSize.setSize((width * zoom) * resolution, (height * zoom) * resolution);
// console.log(this.canvasSize.toString());
}, },
// Fires AFTER the canvas has been added to the DOM // Fires AFTER the canvas has been added to the DOM
@ -251,9 +255,18 @@ var ScaleManager = new Class({
this.canvasSize.setSize(this.parentSize.width, this.parentSize.height); this.canvasSize.setSize(this.parentSize.width, this.parentSize.height);
// var sx = (this.canvasSize.width / this.gameSize.width) / this.resolution;
// var sy = (this.canvasSize.height / this.gameSize.height) / this.resolution;
// style.transformOrigin = '0 0';
// style.transform = 'scale(' + sx + ',' + sy + ')';
style.width = this.canvasSize.width + 'px'; style.width = this.canvasSize.width + 'px';
style.height = this.canvasSize.height + 'px'; style.height = this.canvasSize.height + 'px';
// style.width = this.canvasSize.width / this.resolution + 'px';
// style.height = this.canvasSize.height / this.resolution + 'px';
console.log(this.canvasSize.toString()); console.log(this.canvasSize.toString());
} }
}, },