Is there an easy way to make the textures drawn in a node's custom _draw() method selectable?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Cwazy

One of the objects in my game is completely impractical to draw using sprite nodes, so I’m using a custom _draw() method. The only issue with that is now I can’t select the node (in the viewport) without clicking on its tiny little origin widget. The only way I can think of to fix it is to use an editor plugin:

  1. whenever there’s a click, recursively iterate through every node in the tree
  2. check all those nodes to see if they’re the right type
  3. check if the mouse is within the bounds of any of the node’s drawn textures
  4. set the node to selected and potentially manually handling modifier keys

Am I missing some other obvious solution? This seems pretty unoptimal.

:bust_in_silhouette: Reply From: CollCaz

Is this a game play issue or just an issue for you during development?
Wouldn’t mouse dragging over the node make selecting much easier?

I suppose you could add an area2D node or something else as child of it and write a script that always updates the position of the inconvenient object to be the same as the area2D so you can just select that instead