You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

speech_text.gd 477 B

1234567891011121314151617181920212223242526272829
  1. extends Label
  2. class_name SpeechText
  3. signal click_down
  4. signal click_up
  5. var wait_input := false
  6. func _ready():
  7. text = ""
  8. func _input(event):
  9. if wait_input and event is InputEventMouseButton:
  10. if event.is_pressed(): # Mouse button down.
  11. emit_signal("click_down")
  12. else:
  13. emit_signal("click_up")
  14. func on_new_line(line):
  15. show()
  16. text = line.text
  17. wait_input = true
  18. yield(self, "click_down")
  19. yield(self, "click_up")
  20. wait_input = false
  21. func clear():
  22. text = ''