Slot inventory with sized items

I need to make an inventory with sized items, but i dont know how to do it.

inventory item example:
bandage 1x1 slot
handgun 2x2 slots
rifle 5x2 slots
rpg7 5x2 slots

plz help