mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Fix game on small resolutions
This commit is contained in:
@@ -168,7 +168,11 @@ export class Camera extends BasicSerializableObject {
|
|||||||
* Finds a good initial zoom level
|
* Finds a good initial zoom level
|
||||||
*/
|
*/
|
||||||
findInitialZoom() {
|
findInitialZoom() {
|
||||||
const desiredWorldSpaceWidth = 18 * globalConfig.tileSize;
|
let desiredWorldSpaceWidth = 18 * globalConfig.tileSize;
|
||||||
|
if (window.innerWidth < 1000) {
|
||||||
|
desiredWorldSpaceWidth = 12 * globalConfig.tileSize;
|
||||||
|
}
|
||||||
|
|
||||||
const zoomLevelX = this.root.gameWidth / desiredWorldSpaceWidth;
|
const zoomLevelX = this.root.gameWidth / desiredWorldSpaceWidth;
|
||||||
const zoomLevelY = this.root.gameHeight / desiredWorldSpaceWidth;
|
const zoomLevelY = this.root.gameHeight / desiredWorldSpaceWidth;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user