Well, assuming you have an inventory array/grid of some sort, just have a min and max display value. Loop through the inventory from that min to max and draw them. Once left or right is pressed, increase/decrease the min max values. Finally, have a few sanity checks to make sure max doesn't go over the total number of inventory items and min doesn't go below 0. (also, this type of question is better posted to the programming subforum, rather than the design subforum).