How to identify click event on a Node2D (Godot 3)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Patrick
:warning: Old Version Published before Godot 3 was released.

How can I identify a click event on a particular Node2D in Godot 3? I have some simple code that draws a circle and I want to run code when that circle is clicked.

extends Node2D

func _ready():
	# Called every time the node is added to the scene.
	# Initialization here
	pass

func _draw():
	# part of the CanvasItem class
    draw_circle(Vector2(0,0), 20, Color(1,1,1))
	

Thanks.

:bust_in_silhouette: Reply From: rolfpancake

Use its own _input-method and ask for a InputEventMouseButton event.

You can find some explanaition here:

In the godot demo projects you can find a lot of code implementing such behaviour.