Is there a code snippet to do the following?
I have a 2d scene, with 3 objects (these are items, I am using fruits for example -> apple, banana and an orange).
I would like to drag the items around the screen.
If I drag an item, it should become the topmost item.
when i drop the item over another item, I want it to be on top of it.
since the example is 3 items, I would like to stack 3 items.
of course if I have more items I would like to stack more.
I have difficulty how to write this. I am new to gdscript.
Is there a quick code snippet or example out there that does exactly this without requiring too much modification.
for me this is very important in the style of game I would like to try.