title: how can i dynamically generate a Gui in Unity3D via scripting?
body: <p>I'm having a bit of trouble trying to dynamically generate a Gui in Unity3D.
  I've made a canvas with a panel as a child. I'm trying to populate this Panel with 7x4 images. </p>
  
  <p>I receive a json object that has an x amount of items. Based on the amount of items I populate the panel with the amount of items received. For instance, if i receive a Json object with 28 items(7x4), I want the GUI to look like the following:</p>
  
  <p><a href="https://i.stack.imgur.com/uaF8u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uaF8u.png" alt="enter image description here"></a></p>
  
  <p>So like I've told, I made a canvas with a panel in the editor. In the script I made the following:</p>
  
  <pre><code>public GameObject canvas; //I use this to set the canvas after applying this script to an empty gameobject
  public GameObject panel; // I do the same for the panel
  </code></pre>
  
  <p>In the Start method, i set the canvas as parent for the panel:</p>
  
  <pre><code>panel.transform.SetParent(canvas.transform, false);
  </code></pre>
  
  <p>Now that I set the panel as child to the Canvas, I want to generate 7x4 Images. Could anyone help me with this? What is the best way to generate multiple UI/Images and make it that it shows in the Panel like in the illustration?</p>
  
  <p>Pretty new to Unity3D and I would like to get more familiair with scripting.</p>