How to program house/structure dynamic building with handles in 2D?

Godot Version

4.6

Question

Hello,
I like to understand how to program the option of dynamic house building like in games such as Songs of Syx and RimWorld. When you have handles and when you drag it you can build a house or storage.
Any tutorial like this would be great.