TextEdit.gd 493 B

12345678910111213141516
  1. # This code is borrowed from work by Joshua Moelans
  2. # https://github.com/JoshuaMoelans/Master-Thesis-Godot-exploration (accessed March 2025)
  3. # Originally developed for his master's thesis at the University of Antwerp
  4. extends TextEdit
  5. signal reset_with_instances(count:int)
  6. func _on_gui_input(event):
  7. if event is InputEventKey and event.keycode==KEY_ENTER:
  8. if self.get_text().is_valid_int():
  9. reset_with_instances.emit(int(self.get_text()))
  10. self.visible = false
  11. self.set_text("4")