Some thoughts of mine for implementing such a system would be to:
- Create DIVS within a DIV that hold each position of the inventory
- Go through each item you own in a container and see which DIV it belongs to
- Make said item images the DIVs image
This type of system might possibly work if ALL items were 1x1, but for this example its not going to work out.
I am at a complete lost of ideas how to even accomplish this. Although, maybe rendering directly to the canvas and checking mouse cords could work, there would more than likely be A HUGE annoyance when checking if other items are overlapping each other (meaning you cant place the item down, and possibly switching item with the cursor item ).
That said, what am I left with? Do I need to makeshift my own hack system with messy code, or is there some source out there (that I don't know about) that has replicated this type of system in their own game.
I would be very grateful to get some replies on how you might go about doing this, and will accept answers that can logically explain how you might implement such a system (code is not required).