title: Images in an array, not spacing correctly
body: <p>The shapes are at the top of the image.</p>
  
  <p><a href="http://picturepush.com/public/6472916" rel="nofollow">http://picturepush.com/public/6472916</a></p>
  
  <p>The code looks like this:</p>
  
  <pre><code>    local xOffset = 0
  
      for i = 1, levelPacks[prevCurrentLevelPack][prevCurrentLevel].ammount do
  
          if i == 1 then --setup first one
  
              shapesPrevArray[i].x = 30
              shapesPrevArray[i].y = 41
              shapesPrevArray[i].isVisible = true
  
          end
  
          if i &gt; 1 then --setup the rest
  
              --width of previous one plus the x value of the previous one to make them next to eachother.
              xOffset = shapesPrevArray[i - 1].width + shapesPrevArray[i - 1].x
              print("i:" .. i .. " width:" .. shapesPrevArray[i - 1].width .. " x value:" .. shapesPrevArray[i - 1].x .." xoffset:" .. xOffset)
              shapesPrevArray[i].x = xOffset    
              shapesPrevArray[i].y = 41
              shapesPrevArray[i].isVisible = true
              xOffset = 0
  
          end
  
      end
  </code></pre>
  
  <p>I'm trying to space all of the images in the array out with the same space between each image. Images in the array have different width. The .x value is at the top left corner of the shapes. Any help would be appreciated.</p>