extends Label
class_name SpeechText

signal click_down
signal click_up

var wait_input := false

func _ready():
	text = ""
	
func _input(event):
	if wait_input and event is InputEventMouseButton:
		if event.is_pressed():  # Mouse button down.
			emit_signal("click_down")
		else:
			emit_signal("click_up")

func on_new_line(line):
	show()
	text = line.text
	
	wait_input = true
	yield(self, "click_down")
	yield(self, "click_up")
	wait_input = false

func clear():
	text = ''
