您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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 = ''