extends Area2D

@export var to_alpha := 0.38
@export var fade_out_duration := 0.2
@export var fade_in_duration := 0.2
@export var nodes_to_occlude: Array[Node2D]

func _on_area_entered(_area: Area2D) -> void:
	for node in nodes_to_occlude:
		get_tree().create_tween().tween_property(node, "self_modulate:a", to_alpha, fade_out_duration)


func _on_area_exited(_area: Area2D) -> void:
	for node in nodes_to_occlude:
		get_tree().create_tween().tween_property(node, "self_modulate:a", 1.0, fade_in_duration)
