Inventory

Hi to everybody,

I’m making an isometric engine, and now I need to implement the inventory.
It should be something like Neverwinter Nights, a grid with objects that you get from the map.
Is there any way to implement this? Some component I could use?

Thanks in advance,

David.

i suggest for each main character (object) you have an array of item objects, all which have an icon image.

various diferent item objects eg. weapons, money, potions, can extend the item object to make it easier.

the icon image should be a part of the item class, so that all subclasses have it.

when you are rendering the items, all you need to do is render the grid then the image from each item in the characters item array for example.

for my chess game each movable piece had a bounding recttangle and when the mouse was clicked, the game checked if it’s location fell within one of these rectangles to decide which piece, if any, was selected.