I've created a custom Node2D that draws a circle. I've marked it as a [Tool] so that I can create and use instances of it in the editor.
When I add an instance of it to my project, the only part of it that is pickabler is the origin point gizmo. I'd like the user to be able to select it if they click anywhere in the circular area. Is there a way to do this?
using Godot;
using System;
[Tool]
public class Circle : Node2D
{
private float _radius = 40;
[Export] public float radius {
get { return _radius; }
set { _radius = value; Update(); }
}
private Color _color = new Color(1, 1, 1);
[Export] public Color color {
get { return _color; }
set { _color = value; Update(); }
}
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
public override void _Draw()
{
DrawCircle(new Vector2(), radius, color);
}
}