fix: Adjust initial camera zoom to prevent over-zooming on puzzle load
- Use fitZoom * 0.6 for minZoom to provide comfortable padding around puzzle pieces - Keep initial view at full fitZoom for better first impression and usability
This commit is contained in:
parent
78b7a91fcd
commit
0af6e00469
|
|
@ -826,8 +826,9 @@ class PuzzleScene extends Phaser.Scene {
|
||||||
const cam = this.cameras.main;
|
const cam = this.cameras.main;
|
||||||
|
|
||||||
// Zoom to fit the entire world on screen
|
// Zoom to fit the entire world on screen
|
||||||
this._minZoom = Math.min(width / worldW, height / worldH);
|
const fitZoom = Math.min(width / worldW, height / worldH);
|
||||||
cam.setZoom(this._minZoom);
|
this._minZoom = fitZoom * 0.6;
|
||||||
|
cam.setZoom(fitZoom);
|
||||||
|
|
||||||
// Centre camera on the world.
|
// Centre camera on the world.
|
||||||
// In Phaser 3.9 the camera centre in world space is:
|
// In Phaser 3.9 the camera centre in world space is:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue