Use Control
and its _input_event
function, which only triggers when the input happens inside Control's rect.
Then just set up it's size (set_size(Vector2)
) and you're done.
As I remember _input_event
is connected to the script by default, like _process, _input, etc.