Adjust camera zoom: Default 0.8, Range 0.2-5.0
This commit is contained in:
@@ -82,7 +82,7 @@ export default class GrassSceneClean extends Phaser.Scene {
|
|||||||
this.cameras.main.setBackgroundColor('#3a5f0b'); // Grass Green Background
|
this.cameras.main.setBackgroundColor('#3a5f0b'); // Grass Green Background
|
||||||
|
|
||||||
// --- ZOOM CONTROL ---
|
// --- ZOOM CONTROL ---
|
||||||
this.cameras.main.setZoom(1.5); // Default start zoom
|
this.cameras.main.setZoom(0.8); // Default start zoom (Wider view per user request)
|
||||||
|
|
||||||
this.input.on('wheel', (pointer, gameObjects, deltaX, deltaY, deltaZ) => {
|
this.input.on('wheel', (pointer, gameObjects, deltaX, deltaY, deltaZ) => {
|
||||||
// MACBOOK OPTIMIZATION: Prevent Zoom when hovering over Editor Sidebar
|
// MACBOOK OPTIMIZATION: Prevent Zoom when hovering over Editor Sidebar
|
||||||
@@ -99,8 +99,8 @@ export default class GrassSceneClean extends Phaser.Scene {
|
|||||||
const zoomFactor = -0.001;
|
const zoomFactor = -0.001;
|
||||||
const newZoom = this.cameras.main.zoom + deltaY * zoomFactor;
|
const newZoom = this.cameras.main.zoom + deltaY * zoomFactor;
|
||||||
|
|
||||||
// Clamp zoom to reasonable limits (e.g., 0.5x to 3x)
|
// Clamp zoom to reasonable limits (Extended range)
|
||||||
this.cameras.main.setZoom(Phaser.Math.Clamp(newZoom, 0.5, 3.0));
|
this.cameras.main.setZoom(Phaser.Math.Clamp(newZoom, 0.2, 5.0));
|
||||||
});
|
});
|
||||||
|
|
||||||
// --- 1. PODLAGA (The Foundation) ---
|
// --- 1. PODLAGA (The Foundation) ---
|
||||||
|
|||||||
Reference in New Issue
Block a user