No description
  • GDScript 96.3%
  • GDShader 2%
  • Shell 0.8%
  • Python 0.6%
  • HTML 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Claude f1292db40a #228: shrink the HUD on a screen the canvas is short on
The layout is authored in CANVAS units. With stretch "canvas_items" and
aspect "expand" over a 1920x1080 base, a 720x1280 phone scales by 0.375 and
gets 1920x3413 canvas units - while ANY 16:9-or-wider screen lands on
1920x1080 units however many pixels it really has. The canvas is three times
shorter, so a 148-unit button went from 4.3% of the screen's height to
13.7%. Measured at 3.16x, and confirmed twice: once by hand off the scene
file, once by the test failing with the rule disabled.

Nothing collided. That was checked pair by pair on both canvases and the
same six pairs overlap on each, all of them same-slot alternatives. The
fault was only that everything was enormous.

HudScale captures each HUD control's authored offsets once, then moves it
toward the edge it hangs off and scales the NODE. Scaling the rect alone was
tried first and was wrong: half the HUD draws its own contents at fixed
sizes - ResourceReadout lays its rows out in code, Labels carry their own
font size - so shrunken boxes kept full-size content and the build button
slid up underneath the resource list. Scaling the node takes content and
children with it.

The cost is that position (parent space) and size (local space) now differ
by that scale, and a lot of code here assumed they did not. Five places:

  ResourceReadout.content_bottom() added a scaled position to an unscaled
  height, overstating itself by more than a button - so _seat_hud_columns
  pushed the whole column down to clear space nothing occupied. A live bug,
  not just a bad measurement.
  HUD_COLUMN_MARGIN would have been the one gap still phone-sized.
  _layout_context_buttons wrote its stride and pitch unscaled, landing the
  action row on the building-action row - which is the second of the two
  regressions test_hud_layout was written for, in a new disguise.
  test_hud_layout and test_hangar_management compared authored rects.

And HudScale reapplies on resize, which wiped the two layouts BuildController
writes at runtime - so dragging a desktop window left the context row where
it was. Both re-run on size_changed now, deferred, because which of two
siblings connected first is not a thing to depend on.

test_hud_layout ran at one window shape, which happened to be the desktop
canvas. It now runs every check at both, so this cannot hide at whichever
shape was not being exercised.

Rejected: scaling the UI CanvasLayer does not work at all - Control anchors
resolve against the viewport rect, so bottom-anchored elements land
mid-screen. A single scaled wrapper Control with the HUD reparented under it
is the genuinely clean shape and would need no scale-aware arithmetic
anywhere, but it changes every node path and would break every get_node in
the controllers and tests.

MIN_SCALE floors the shrink at 0.45 rather than the proportional 0.316: a
landscape phone gets the same short canvas as a desktop, and there the
sticks are still thumb targets. That leaves the HUD at 1.42x its phone share
on a PC rather than 1.0x.

177/177 at JOBS=3.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
2026-09-12 18:04:00 +02:00
android Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1 2026-08-10 18:41:58 +02:00
audio #224: refuse to build a structure on top of another 2026-09-09 12:57:28 +02:00
boss Take planets by killing what defends them 2026-09-05 13:31:25 +02:00
buildings Keep the export probe, and the uid files beside the new scripts 2026-09-07 16:40:45 +02:00
controllers #228: shrink the HUD on a screen the canvas is short on 2026-09-12 18:04:00 +02:00
core #227: resume at the mothership, with the crew the save had 2026-09-12 15:57:48 +02:00
enemies Tune and optimize boss encounter 2026-09-03 11:49:51 +02:00
fonts Skill tree, node-based building animation, bigger UI, and a 19x faster test suite 2026-08-11 15:00:41 +02:00
logistics Research the Fleet Office, and give it one hull 2026-09-05 21:57:53 +02:00
planets #227: resume at the mothership, with the crew the save had 2026-09-12 15:57:48 +02:00
PlanetSetups Take planets by killing what defends them 2026-09-05 13:31:25 +02:00
resources #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
shaders Tune and optimize boss encounter 2026-09-03 11:49:51 +02:00
shots Remove the one-way ore API superseded by the transfer menu 2026-08-12 13:07:52 +02:00
surface Find the planet setups in an exported build 2026-09-07 13:55:41 +02:00
tests #228: shrink the HUD on a screen the canvas is short on 2026-09-12 18:04:00 +02:00
ui #228: shrink the HUD on a screen the canvas is short on 2026-09-12 18:04:00 +02:00
vessels Research the Fleet Office, and give it one hull 2026-09-05 21:57:53 +02:00
vfx Stop redrawing what only needs moving 2026-09-08 11:35:45 +02:00
world #228: shrink the HUD on a screen the canvas is short on 2026-09-12 18:04:00 +02:00
.gitignore Add a WSL path to the test runner 2026-08-22 14:40:44 +02:00
export_presets.cfg Fix the web build: a wasm trap on integer % 0, and buttons that never fired 2026-08-19 01:08:09 +02:00
icon.svg Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1 2026-08-10 18:41:58 +02:00
icon.svg.import Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1 2026-08-10 18:41:58 +02:00
project.godot Smooth boosted fleet travel 2026-09-04 20:01:56 +02:00
ui_theme.tres Skill tree, node-based building animation, bigger UI, and a 19x faster test suite 2026-08-11 15:00:41 +02:00
web_shell.html Fix the web build: a wasm trap on integer % 0, and buttons that never fired 2026-08-19 01:08:09 +02:00