I think you asked this question on another forum too? I answered it there but in case you missed it, here it is for who needs it.
you need a variable to toggle on/off to show that your sprite can be clicked. Have that variable change whenever the mouse enters, change your signal to mouse entered (and have a second signal for mouse exited to turn the var off) and whenever the mouse enters, if the bool is flipped, have the click occur. The problem with running a check on the input event is it is only running when an input occurs. You need to make a function that tracks input vs location.
So everything up to that signal is fine. Just a bit of rework to try, you may want to play with the logic to get it right.
extends Area2D
var position_draw = Vector2(200, 100)
var _can_click = false
func _ready():
var a = Sprite.new()
a.name = "test_sprite"
a.texture = load("res://img/120px-Roundel_of_El_Salvador.svg.png")
a.position = position_draw
self.add_child(a, true)
var coll = CollisionShape2D.new()
coll.name = "test_collision"
var circle = CircleShape2D.new()
circle.radius = 200
coll.shape = circle
coll.position = position_draw
self.add_child(coll)
self.connect("mouse_entered", self, "_on_Area2D_mouse_entered")
self.connect("mouse_exited", selfm "_on_Area_2D_mouse_exited")
func _on_Area2D_mouse_entered():
_can_click = true
func _on_Area2D_mouse_exited():
_can_click = false
func _click_check():
if _can_click:
if Input.is_action_pressed("click"):
print('Click')
func _process(_delta):
_click_check()