Fix garden visuals: tint, sizing, button layout and colors

- Tint garden background #176d78 via modulate in set_background()
- Fix background as 1700x1700 centered square instead of stretched
- Make TextureButton self_modulate transparent so Center/Border are visible
- Diagonal lesson layout from bottom-left to upper-right matching mockup
- Center buttons on generated positions instead of top-left alignment
- Increase garden size back to 2400 with 850px circle radius

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adrien Ufferte
2026-03-31 11:22:46 +02:00
parent d9522bc922
commit dc83e7b4e2
5 changed files with 33 additions and 26 deletions
+5 -2
View File
@@ -95,9 +95,11 @@ func set_lesson_buttons(p_lesson_buttons: Array[GardenLayout.GardenLayoutLessonB
for index: int in range(p_lesson_buttons.size()): for index: int in range(p_lesson_buttons.size()):
var lesson_button: GardenLayout.GardenLayoutLessonButton = p_lesson_buttons[index] var lesson_button: GardenLayout.GardenLayoutLessonButton = p_lesson_buttons[index]
var lesson_button_control: LessonButton = lesson_buttons[index] var lesson_button_control: LessonButton = lesson_buttons[index]
lesson_button_control.position = Vector2(lesson_button.position) # Center the button on the generated position
var half_size: Vector2 = lesson_button_control.size / 2.0
lesson_button_control.position = Vector2(lesson_button.position) - half_size
lesson_button_control.show() lesson_button_control.show()
lesson_button_control.pivot_offset = lesson_button_control.size / 2 lesson_button_control.pivot_offset = half_size
func set_background(p_color: int) -> void: func set_background(p_color: int) -> void:
@@ -108,6 +110,7 @@ func set_background(p_color: int) -> void:
background.texture = load(path) background.texture = load(path)
else: else:
background.texture = load(BACKGROUND_PATH_MODEL % [1]) background.texture = load(BACKGROUND_PATH_MODEL % [1])
background.modulate = Color("176d78")
color = garden_colors[p_color] color = garden_colors[p_color]
for button: LessonButton in get_lesson_buttons(): for button: LessonButton in get_lesson_buttons():
button.completed_color = color button.completed_color = color
+11 -12
View File
@@ -6,7 +6,7 @@
[ext_resource type="PackedScene" uid="uid://delcgui3v0eek" path="res://sources/lesson_screen/lesson_button.tscn" id="4_epm30"] [ext_resource type="PackedScene" uid="uid://delcgui3v0eek" path="res://sources/lesson_screen/lesson_button.tscn" id="4_epm30"]
[node name="Garden" type="Control" unique_id=1950346826] [node name="Garden" type="Control" unique_id=1950346826]
custom_minimum_size = Vector2(1800, 2.08165e-12) custom_minimum_size = Vector2(2400, 2.08165e-12)
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@@ -19,16 +19,15 @@ garden_colors = Array[Color]([Color(0.588235, 0.439216, 0.878431, 1), Color(1, 0
[node name="Background" type="TextureRect" parent="." unique_id=667507132] [node name="Background" type="TextureRect" parent="." unique_id=667507132]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 1 layout_mode = 0
anchors_preset = 15 offset_left = 350.0
anchor_right = 1.0 offset_top = 50.0
anchor_bottom = 1.0 offset_right = 2050.0
grow_horizontal = 2 offset_bottom = 1750.0
grow_vertical = 2
mouse_filter = 2 mouse_filter = 2
texture = ExtResource("3_p7iv3") texture = ExtResource("3_p7iv3")
expand_mode = 1 expand_mode = 1
stretch_mode = 3 stretch_mode = 0
[node name="Buttons" type="Control" parent="." unique_id=1943933146] [node name="Buttons" type="Control" parent="." unique_id=1943933146]
layout_mode = 1 layout_mode = 1
@@ -45,10 +44,10 @@ completed_color = Color(0.588235, 0.439216, 0.878431, 1)
[node name="Jellyfish" type="TextureRect" parent="."] [node name="Jellyfish" type="TextureRect" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 1300.0 offset_left = 1550.0
offset_top = 80.0 offset_top = -30.0
offset_right = 1500.0 offset_right = 1830.0
offset_bottom = 420.0 offset_bottom = 450.0
mouse_filter = 2 mouse_filter = 2
texture = ExtResource("jellyfish_tex") texture = ExtResource("jellyfish_tex")
expand_mode = 1 expand_mode = 1
+1
View File
@@ -7,6 +7,7 @@
[node name="BossButton" type="TextureButton" unique_id=1297494779] [node name="BossButton" type="TextureButton" unique_id=1297494779]
z_index = 2 z_index = 2
self_modulate = Color(1, 1, 1, 0)
offset_right = 512.0 offset_right = 512.0
offset_bottom = 512.0 offset_bottom = 512.0
pivot_offset = Vector2(180, 180) pivot_offset = Vector2(180, 180)
+15 -12
View File
@@ -9,20 +9,19 @@ const LOOK_AND_LEARN_SCENE: PackedScene = preload("res://sources/look_and_learn/
const BOSS_BUTTON_SCENE: PackedScene = preload("res://sources/gardens/boss_button.tscn") const BOSS_BUTTON_SCENE: PackedScene = preload("res://sources/gardens/boss_button.tscn")
const BOSS_MINIGAME_SCENE_PATH: String = "res://sources/minigames/boss/boss_minigame.tscn" const BOSS_MINIGAME_SCENE_PATH: String = "res://sources/minigames/boss/boss_minigame.tscn"
const FLOWER_VFX: PackedScene = preload("res://sources/gardens/flower_particle.tscn") const FLOWER_VFX: PackedScene = preload("res://sources/gardens/flower_particle.tscn")
const GARDEN_SIZE: int = 1800 const GARDEN_SIZE: int = 2400
const GARDEN_TEXTURES_NB: int = 20 const GARDEN_TEXTURES_NB: int = 20
const FLOWER_TYPES_NB: int = 5 const FLOWER_TYPES_NB: int = 5
const FLOWER_OFFSET_FROM_LESSON: float = 150.0 const FLOWER_OFFSET_FROM_LESSON: float = 150.0
const GARDEN_CENTER_Y: float = 900.0 const GARDEN_CENTER_Y: float = 900.0
const GARDEN_CIRCLE_RADIUS: float = 650.0 const GARDEN_CIRCLE_RADIUS: float = 850.0
const LESSON_CIRCLE_RADIUS: float = 450.0 const LESSON_PATH_SPREAD: float = 0.85
const LESSON_START_ANGLE: float = -PI / 2.0
const FINAL_BOSS_PADDING: float = 120.0 const FINAL_BOSS_PADDING: float = 120.0
const TRANSPARENCY_THRESHOLD: float = 0.05 const TRANSPARENCY_THRESHOLD: float = 0.05
const POSITION_SEARCH_STEP: int = 40 const POSITION_SEARCH_STEP: int = 40
const MAX_POSITION_SEARCH_RADIUS: int = 300 const MAX_POSITION_SEARCH_RADIUS: int = 300
const BACK_BUTTON_HOLD_DURATION_SECONDS: float = 1.0 const BACK_BUTTON_HOLD_DURATION_SECONDS: float = 1.0
const LAYOUT_VERSION: int = 2 const LAYOUT_VERSION: int = 8
static var lesson_button_half_size: Vector2 = Vector2.ZERO static var lesson_button_half_size: Vector2 = Vector2.ZERO
static var garden_alpha_cache: Dictionary = {} static var garden_alpha_cache: Dictionary = {}
@@ -751,14 +750,18 @@ static func _generate_lesson_positions(lessons_for_garden: int, garden_index: in
positions.append(Vector2i(int(center.x), int(center.y))) positions.append(Vector2i(int(center.x), int(center.y)))
Log.trace("Gardens: Garden %s single lesson placed at center" % str(garden_index)) Log.trace("Gardens: Garden %s single lesson placed at center" % str(garden_index))
else: else:
var angle_step: float = TAU / float(lessons_for_garden) # Diagonal path from bottom-left to upper-right through the circle,
var phase_offset: float = float(garden_index % 5) * 0.4 # matching the design mockup layout.
var half_spread: float = GARDEN_CIRCLE_RADIUS * LESSON_PATH_SPREAD * 0.5
for lesson_index: int in range(lessons_for_garden): for lesson_index: int in range(lessons_for_garden):
var angle: float = LESSON_START_ANGLE + phase_offset + angle_step * float(lesson_index) var t: float = float(lesson_index) / float(lessons_for_garden - 1)
var x_pos: int = int(center.x + cos(angle) * LESSON_CIRCLE_RADIUS) # Diagonal: bottom-left (t=0) to upper-right (t=1)
var y_pos: int = int(center.y + sin(angle) * LESSON_CIRCLE_RADIUS) var x_pos: float = center.x + (t - 0.5) * half_spread * 2.0
Log.trace("Gardens: Garden %s lesson %s angle: %s, position: (%s, %s)" % [str(garden_index), str(lesson_index), str(angle), str(x_pos), str(y_pos)]) var y_pos: float = center.y + (0.5 - t) * half_spread * 1.6
positions.append(Vector2i(x_pos, y_pos)) # Slight sine curve to avoid a straight line
x_pos += sin(t * PI) * GARDEN_CIRCLE_RADIUS * 0.08
Log.trace("Gardens: Garden %s lesson %s t: %s, position: (%s, %s)" % [str(garden_index), str(lesson_index), str(t), str(x_pos), str(y_pos)])
positions.append(Vector2i(int(x_pos), int(y_pos)))
Log.info("Gardens: Completed lesson positions for garden %s" % str(garden_index)) Log.info("Gardens: Completed lesson positions for garden %s" % str(garden_index))
return positions return positions
+1
View File
@@ -6,6 +6,7 @@
[node name="LessonButton" type="TextureButton" unique_id=530361935] [node name="LessonButton" type="TextureButton" unique_id=530361935]
z_index = 1 z_index = 1
self_modulate = Color(1, 1, 1, 0)
offset_right = 300.0 offset_right = 300.0
offset_bottom = 300.0 offset_bottom = 300.0
pivot_offset = Vector2(150, 150) pivot_offset = Vector2(150, 150)