I created a bunch of rectangles using for loop and then added them to an array list. I taught that the rendering would be similar the way you render userdata from box2d.
sr.setProjectionMatrix(camera.combined);
sr.begin(ShapeRenderer.ShapeType.Filled);
for(Rectangle r : rectangles)
sr.rect(r.x, r.y, r.width, r.height);
sr.end();
the problem is that after the fro loop is over, the rectangles are not being rendered anymore, I know that this is happening because you are not rendering the actual rectangle but just using shapeRenderer to draw a shape using the attributes of the rectangles. Is there a way to do this that is similar the way you render a sprite?