How do I split up an array and read each item into a GUI element?

I'm trying to create an inventory system for a game I'm working on. I need to be able to read each element of an array into a GUI element. Unfortunately for me, I don't know how to do this.

I was thinking something like a for loop with an x coordinate for a rect that increases each time around, but I thought if I asked here, I would save valuable hours and perhaps even days trying to figure it out myself.

Thanks - Elliot Bonneville

There's an example here which uses a for loop to draw an array of toggles.

In that example, it uses the number of children of the gameobject as the array of items, so you'd want to substitute that for your inventory array.

Also you would probably want to use buttons instead of toggle items for the actual GUI elements for each item.

This should give you a good start though.