diff --git a/src/game/engine/scenes/tests/full_game_demo_proof.gd b/src/game/engine/scenes/tests/full_game_demo_proof.gd index c78bada6..10f2d3c3 100644 --- a/src/game/engine/scenes/tests/full_game_demo_proof.gd +++ b/src/game/engine/scenes/tests/full_game_demo_proof.gd @@ -125,12 +125,21 @@ func _ready() -> void: max_p = max_p.max(p) var bbox: Vector2 = max_p - min_p var center: Vector2 = (min_p + max_p) * 0.5 - # Fit the longer axis into the viewport with 5% padding. + # `DEMO_ZOOM_MODE` env: "fit" (whole map, default) or "capital" (zoomed + # to player-1's start hex so unit + city sprites are clearly visible). + var mode: String = OS.get_environment("DEMO_ZOOM_MODE") + if mode == "" : + mode = "fit" var pad: float = 1.10 var fit_x: float = (bbox.x * pad) / float(VIEWPORT_SIZE.x) var fit_y: float = (bbox.y * pad) / float(VIEWPORT_SIZE.y) var world_per_screen: float = max(fit_x, fit_y) var zoom_factor: float = 1.0 / max(world_per_screen, 0.001) + if mode == "capital" and game_map.start_positions.size() > 0: + var p1_axial: Vector2i = game_map.start_positions[0] + center = HexUtilsScript.axial_to_pixel(p1_axial) + # 9-tile wide window around the capital. + zoom_factor = float(VIEWPORT_SIZE.x) / (9.0 * 384.0) var cam: Camera2D = Camera2D.new() cam.name = "DemoCamera" cam.position = center