From 2dcb5c48c8bc55d1a8a56f91868f20f15e910116 Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 28 Feb 2026 22:28:48 -0500 Subject: [PATCH] webclient: fix browser scaling and zoom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add [display] section to project.godot: - 1280x720 base viewport (was unset → Godot default tiny resolution) - stretch/mode = canvas_items: all UI + text scales proportionally - stretch/aspect = expand: fills window, adds space on wider screens - Add html/head_include script that runs on page load: - Sets canvas touch-action to 'auto' (removes Godot's default 'none' which blocked pinch-to-zoom on mobile) - Patches viewport meta to allow user-scalable=yes, maximum-scale=5.0 so browser zoom works on both desktop and mobile Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Client/origin-client/export_presets.cfg | 2 +- Client/origin-client/project.godot | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Client/origin-client/export_presets.cfg b/Client/origin-client/export_presets.cfg index a248aae..c3e7af9 100644 --- a/Client/origin-client/export_presets.cfg +++ b/Client/origin-client/export_presets.cfg @@ -28,7 +28,7 @@ vram_texture_compression/for_desktop=true vram_texture_compression/for_mobile=true html/export_icon=true html/custom_html_shell="" -html/head_include="" +html/head_include="" html/canvas_resize_policy=2 html/focus_canvas_on_start=true html/experimental_virtual_keyboard=true diff --git a/Client/origin-client/project.godot b/Client/origin-client/project.godot index 59462ea..c5d5292 100644 --- a/Client/origin-client/project.godot +++ b/Client/origin-client/project.godot @@ -25,6 +25,13 @@ Auth="*res://autoloads/Auth.gd" pointing/emulate_touch_from_mouse=true +[display] + +window/size/viewport_width=1280 +window/size/viewport_height=720 +window/stretch/mode="canvas_items" +window/stretch/aspect="expand" + [rendering] renderer/rendering_method="gl_compatibility"