Release v0.3: adapt Android layout to wide screens

This commit is contained in:
enne2
2026-09-07 18:34:13 +02:00
parent ea5b2aebbf
commit d0991a0edf
6 changed files with 26 additions and 16 deletions
+7 -6
View File
@@ -26,25 +26,26 @@ func _ready() -> void:
func _build() -> void:
var ink := Color("#251b17")
var x_scale := JuggleBoardConfig.horizontal_scale(get_viewport().get_visible_rect().size.x)
# Node2D ha pivot locale (0, 0); target_dot disegna l'asset simmetricamente
# intorno a quel pivot, quindi si usa il centro misurato della cornice P2B.
target_dot = TARGET_SCRIPT.new()
target_dot.position = JuggleBoardConfig.TARGET_CENTER
target_dot.position = Vector2(JuggleBoardConfig.TARGET_CENTER.x * x_scale, JuggleBoardConfig.TARGET_CENTER.y)
add_child(target_dot)
back_button = _make_back_button()
add_child(back_button)
score_label = _make_label("", Vector2(112, 520), Vector2(220, 45), 25, ink)
score_label = _make_label("", Vector2(112 * x_scale, 520), Vector2(220 * x_scale, 45), 25, ink)
score_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
score_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
combo_label = _make_label("", Vector2(112, 606), Vector2(220, 45), 24, ink)
combo_label = _make_label("", Vector2(112 * x_scale, 606), Vector2(220 * x_scale, 45), 24, ink)
combo_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
combo_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
hearts = HEARTS_SCRIPT.new()
hearts.position = Vector2(84, 655)
hearts.position = Vector2(84 * x_scale, 655)
hearts.visible = false
add_child(hearts)
@@ -53,7 +54,7 @@ func _build() -> void:
help_label = _make_label("", Vector2.ZERO, Vector2.ZERO, 1, ink)
help_label.visible = false
milestone_label = _make_label("", Vector2(350, 20), Vector2(820, 80), 46, Color("#9e5420"))
milestone_label = _make_label("", Vector2(350 * x_scale, 20), Vector2(820 * x_scale, 80), 46, Color("#9e5420"))
milestone_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
milestone_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
milestone_label.visible = false
@@ -61,7 +62,7 @@ func _build() -> void:
flash = ColorRect.new()
flash.color = Color(1, 0.95, 0.72)
flash.position = Vector2.ZERO
flash.size = JuggleBoardConfig.VIEW
flash.size = get_viewport().get_visible_rect().size
flash.mouse_filter = Control.MOUSE_FILTER_IGNORE
flash.modulate.a = 0.0
flash.visible = false