click_listen.gd 548 B

12345678910111213141516171819202122
  1. extends Polygon2D
  2. onready var MAIN = find_parent("MAIN")
  3. # Declare member variables here. Examples:
  4. # var a: int = 2
  5. # var b: String = "text"
  6. # Called when the node enters the scene tree for the first time.
  7. func _ready() -> void:
  8. $TextureRect.connect("gui_input", self, "on_input")
  9. pass # Replace with function body.
  10. func on_input(event: InputEvent):
  11. if event is InputEventMouseButton:
  12. MAIN.start()
  13. visible = false
  14. # Called every frame. 'delta' is the elapsed time since the previous frame.
  15. #func _process(delta: float) -> void:
  16. # pass