#Making a hotbar with drag and drop function

6 messages · Page 1 of 1 (latest)

wicked forge
#

I have looked at several tutorials now but none seem to explain what I want and also confuse me very much. My plan is to have a hotbar in the bottom center with 6 slots to hold seeds for "Thought Plants", these seeds should be able to be dragged onto flowerpots, that will be on the shelves but thats also something i dont really seem to get started on. I have a texture for a hotbar slot and tried some stuff but nothing worked how i wanted it to. Any help is appreciated.

drifting sentinel
#

sorry buddy i have no idea ima begg=inner

#

i upvoted to boost you dw twin ❤️

wicked forge
#

Little update, i have a kinda working hotbar now, i can drag the "Test Seed" between the hotbar slots but not yet onto the flowerpots, also when i drag it anywhere else than the slots the item dissappears and i didnt find a solution yet that wont have me change my whole workspace

sonic light
#

Seems like you remove the item from the hotbar any time it is dragged off, regardless of the result.
You should connect to some signal that reports the result of the drop and THEN decide what to do with the original.

If you want to have non-UI stuff you can send inputs to, check Area2D as it can receive inputs trough its input_event signal and its _input_event() function.

wicked forge
#

Thats what im doing, I never used an Area2D before tho so i dont know how to implement that