Fix UI overlaps: SpeedFader vs status labels, packed ship lab layout (#67, #71)

SpeedFader was missing anchor_top/anchor_bottom = 1.0 in both Main.tscn
and PlanetSurface.tscn, so it rendered TOP-anchored at a fixed y while
its siblings (LaserStatus, GasBombStatus) are bottom-anchored - on a
720x1280 viewport both landed in the same screen region, directly on
top of each other. Properly bottom-anchored SpeedFader now, positioned
above both status labels instead.

Separately, the ship lab's 7 vessel-name labels (#57-#59 grew the
roster from 4 to 7 without widening their row) were laid out 120px wide
on only a 90px pitch - a fixed 30px overlap between adjacent labels
regardless of text length, worse for genuinely long names like
"Interceptor"/"Transporter". Narrowed each label to fit its own lane
with real gaps, dropped the font size, and enabled word-wrap; shifted
the upgrade-card rows below down to give the now-taller label row room.
This commit is contained in:
Loïc Wisniewski 2026-08-17 19:47:09 +02:00
commit 42535c7320
3 changed files with 74 additions and 71 deletions

107
Main.tscn
View file

@ -227,10 +227,12 @@ visible = false
mouse_filter = 2
anchor_left = 1.0
anchor_right = 1.0
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = -94
offset_right = -24
offset_top = 740
offset_bottom = 920
offset_top = -720
offset_bottom = -560
script = ExtResource("31")
[node name="Label" type="Label" parent="UI/SpeedFader"]
@ -1295,11 +1297,12 @@ text = ""
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -330
offset_right = -210
offset_left = -310
offset_right = -230
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
offset_bottom = 472
theme_override_font_sizes/font_size = 15
autowrap_mode = 2
horizontal_alignment = 1
text = "Interceptor"
@ -1307,11 +1310,12 @@ text = "Interceptor"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -240
offset_right = -120
offset_left = -220
offset_right = -140
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
offset_bottom = 472
theme_override_font_sizes/font_size = 15
autowrap_mode = 2
horizontal_alignment = 1
text = "Shield"
@ -1319,11 +1323,12 @@ text = "Shield"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -150
offset_right = -30
offset_left = -130
offset_right = -50
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
offset_bottom = 472
theme_override_font_sizes/font_size = 15
autowrap_mode = 2
horizontal_alignment = 1
text = "Gas Bomber"
@ -1331,11 +1336,12 @@ text = "Gas Bomber"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = -60
offset_right = 60
offset_left = -40
offset_right = 40
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
offset_bottom = 472
theme_override_font_sizes/font_size = 15
autowrap_mode = 2
horizontal_alignment = 1
text = "Transporter"
@ -1343,11 +1349,12 @@ text = "Transporter"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 30
offset_right = 150
offset_left = 50
offset_right = 130
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
offset_bottom = 472
theme_override_font_sizes/font_size = 15
autowrap_mode = 2
horizontal_alignment = 1
text = "Carrier"
@ -1355,11 +1362,12 @@ text = "Carrier"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 120
offset_right = 240
offset_left = 140
offset_right = 220
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
offset_bottom = 472
theme_override_font_sizes/font_size = 15
autowrap_mode = 2
horizontal_alignment = 1
text = "Laser Ship"
@ -1367,11 +1375,12 @@ text = "Laser Ship"
mouse_filter = 2
anchor_left = 0.5
anchor_right = 0.5
offset_left = 210
offset_right = 330
offset_left = 230
offset_right = 310
offset_top = 400
offset_bottom = 460
theme_override_font_sizes/font_size = 22
offset_bottom = 472
theme_override_font_sizes/font_size = 15
autowrap_mode = 2
horizontal_alignment = 1
text = "Distorder"
@ -1379,9 +1388,9 @@ text = "Distorder"
mouse_filter = 2
anchor_right = 1.0
offset_left = 48
offset_top = 462
offset_top = 480
offset_right = -48
offset_bottom = 466
offset_bottom = 484
color = Color(0.25, 0.85, 1, 0.6)
[node name="UpgradeList" type="Label" parent="UI/LabMenu"]
@ -1390,7 +1399,7 @@ mouse_filter = 2
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 32
offset_top = 470
offset_top = 488
offset_right = -32
offset_bottom = -470
theme_override_font_sizes/font_size = 30
@ -1472,8 +1481,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = -240
offset_right = -120
offset_top = 470
offset_bottom = 580
offset_top = 488
offset_bottom = 598
script = ExtResource("10")
icon = 13
glow_color = Color(0.25, 0.85, 1, 1)
@ -1484,8 +1493,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = -310
offset_right = -50
offset_top = 585
offset_bottom = 655
offset_top = 603
offset_bottom = 673
theme_override_font_sizes/font_size = 22
autowrap_mode = 2
horizontal_alignment = 1
@ -1496,8 +1505,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = 120
offset_right = 240
offset_top = 470
offset_bottom = 580
offset_top = 488
offset_bottom = 598
script = ExtResource("10")
icon = 13
glow_color = Color(0.25, 0.85, 1, 1)
@ -1508,8 +1517,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = 50
offset_right = 310
offset_top = 585
offset_bottom = 655
offset_top = 603
offset_bottom = 673
theme_override_font_sizes/font_size = 22
autowrap_mode = 2
horizontal_alignment = 1
@ -1520,8 +1529,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = -240
offset_right = -120
offset_top = 660
offset_bottom = 765
offset_top = 678
offset_bottom = 783
script = ExtResource("10")
icon = 13
glow_color = Color(0.25, 0.85, 1, 1)
@ -1532,8 +1541,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = -310
offset_right = -50
offset_top = 770
offset_bottom = 815
offset_top = 788
offset_bottom = 833
theme_override_font_sizes/font_size = 22
autowrap_mode = 2
horizontal_alignment = 1
@ -1544,8 +1553,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = 120
offset_right = 240
offset_top = 660
offset_bottom = 765
offset_top = 678
offset_bottom = 783
script = ExtResource("10")
icon = 13
glow_color = Color(0.25, 0.85, 1, 1)
@ -1556,8 +1565,8 @@ anchor_left = 0.5
anchor_right = 0.5
offset_left = 50
offset_right = 310
offset_top = 770
offset_bottom = 815
offset_top = 788
offset_bottom = 833
theme_override_font_sizes/font_size = 22
autowrap_mode = 2
horizontal_alignment = 1

View file

@ -163,10 +163,12 @@ visible = false
mouse_filter = 2
anchor_left = 1.0
anchor_right = 1.0
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = -94
offset_right = -24
offset_top = 740
offset_bottom = 920
offset_top = -720
offset_bottom = -560
script = ExtResource("17")
glow_color = Color(0.5, 0.18, 0.6, 1)
core_color = Color(0.02, 0.09, 0.15, 1)

View file

@ -1,37 +1,29 @@
extends Node2D
# Preview, not a test. The ship lab's upgrade screen (#5), so its layout can
# be checked on a real viewport - headless draws no pixels.
# Preview, not a test - #71's ship lab layout with all 7 vessels present,
# checking the vessel-name row no longer overlaps itself.
#
# bash tests/screenshot.sh res://tests/_lab_menu_preview.tscn /tmp/lab.png 20 720x1280
var configured: bool = false
func _ready() -> void:
func _process(_delta: float) -> void:
if configured:
return
configured = true
GameState.buildings.clear()
GameState.extractors.clear()
GameState.transporters.clear()
GameState.reset_progression()
GameState.rocks = 240
GameState.gas = 36
GameState.unlocked = ["shipyards", "vessel_science"]
GameState.rocks = 500
GameState.research_points = 5
var main: Node = load("res://Main.tscn").instantiate()
add_child(main)
main.get_node("BackgroundLayer").visible = false
main.get_node("Fleet").visible = false
main.get_node("AsteroidField").visible = false
main.get_node("PlanetField").visible = false
main.get_node("BuildingField").visible = false
main.get_node("EnemySpawner").set_process(false)
main.get_node("AsteroidField").set_process(false)
main.get_node("BuildingField").place(GameState.BUILDING_SHIP_LAB, Vector2(400.0, 0.0))
var lab_id: int = int(GameState.buildings[-1].id)
GameState.deposit_to_building(lab_id, 18)
GameState.fleet_cargo = 12
GameState.fleet_gas_cargo = 8
var bc: Node = main.get_node("BuildController")
# The shared header (#24) hides its HERE column when it has no building,
# so bind it the way opening the panel from the building does.
for bar in bc.resource_bars:
bar.building_id = lab_id
bc.lab_building_id = lab_id
main.get_node("UI/LabMenu").visible = true
bc.lab_vessel = GameState.VESSEL_GAS_BOMBER
bc._refresh_lab()