Hello. I am currently working on an rpg and so far I have found know tutorials on how to create a minecraft style hot bar on my game and was wondering if anyone knows how. Please implement how to switch the selected item and how to drag and drop items into the hot bar.
with minecraft the hotbar is part of the inventory as an array, so you literally just set an inventory slot to be active.
dragging and dropping requires bounds on where the icon will snap to, and when it snaps to that spot it sets that array index to it’s item id.
to scroll through the hotbar you only need to add or subtract one from an int so that the array index is stored, then setting the selector over that location.