12 lines
279 B
GDScript
12 lines
279 B
GDScript
extends CanvasLayer
|
|
|
|
@onready var color_rect: ColorRect = $ColorRect
|
|
|
|
func _ready() -> void:
|
|
color_rect.color.a = 0
|
|
|
|
func fade(target_alpha: float, duration: float):
|
|
var tween = create_tween()
|
|
tween.tween_property(color_rect, "color:a", target_alpha, duration)
|
|
return tween
|