ld58-collector/captions.gd

15 lines
331 B
GDScript

extends Label
class_name CaptionLabel
var _tween: Tween
func display_caption(msg: String) -> void:
text = msg
modulate = Color.WHITE
if _tween: _tween.kill()
_tween = create_tween()
_tween.tween_interval(30.0)
_tween.tween_property(self, ^'modulate', Color.TRANSPARENT, 3.0)
_tween.tween_callback(func(): _tween = null)