feat: animate tent anchor lights and curtain reverse on hover out

This commit is contained in:
enne2
2026-09-10 22:50:33 +02:00
parent 717a702fb2
commit 95ccfc4c92
8 changed files with 40 additions and 4 deletions
+12 -4
View File
@@ -63,13 +63,21 @@ func _build() -> void:
func _add_tent_button(texture: Texture2D, center: Vector2, has_lights := false) -> TextureButton:
var button := MenuUI.add_image_button(self, texture, center, Vector2(0.36, 0.59))
var star_mat := MenuUI.tent_star_material()
button.material = star_mat
var mat := MenuUI.tent_material(0.0) if has_lights else MenuUI.tent_star_material()
button.material = mat
button.tooltip_text = "Apri questo percorso"
# Glow stella su entrambi i tendoni al passaggio del mouse
button.mouse_entered.connect(func(): star_mat.set_shader_parameter("hover_strength", 1.0))
button.mouse_exited.connect(func(): star_mat.set_shader_parameter("hover_strength", 0.0))
button.mouse_entered.connect(func():
mat.set_shader_parameter("hover_strength", 1.0)
if has_lights:
mat.set_shader_parameter("garland_strength", 1.0)
)
button.mouse_exited.connect(func():
mat.set_shader_parameter("hover_strength", 0.0)
if has_lights:
mat.set_shader_parameter("garland_strength", 0.0)
)
# Animazione apertura sipario e lucine in hover
if has_lights: