title: How to make GUI.Box corners rounded in Unity programmatically
body: <p>I don't know much about C# and Unity. I just follow the script in <a href="https://library.vuforia.com/content/vuforia-library/en/articles/Solution/How-To-Implement-Cloud-Reco.html#unity" rel="nofollow noreferrer">Vuforia's Unity Cloud Recognition tutorial</a>, which creates the GUI Box programmatically. So I guess all the stying solutions using the Unity <code>Inspector</code> are not working for me.</p>
  
  <p><strong>My current GUI.Box style</strong></p>
  
  <pre><code>Texture2D texture = new Texture2D(1, 1);
  texture.SetPixel(0,0,Color.white);
  texture.Apply();
  
  GUIStyle myBoxStyle2 = new GUIStyle(GUI.skin.box);
  myBoxStyle2.fontSize = 40;
  myBoxStyle2.normal.background = texture;
  myBoxStyle2.normal.textColor = Color.black;
  myBoxStyle2.alignment = TextAnchor.MiddleLeft;
  GUI.Box (new Rect(Screen.width/4,Screen.height/6,Screen.width/2,Screen.height/8), mTargetMetadata, myBoxStyle2);
  </code></pre>
  
  <p>And it looks like this (the white box)</p>
  
  <p><a href="https://i.stack.imgur.com/DJAxR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DJAxR.png" alt="enter image description here"></a></p>
  
  <p>I checked the <a href="https://docs.unity3d.com/540/Documentation/Manual/class-GUIStyle.html" rel="nofollow noreferrer">GUI Style Manual</a>, not helped.</p>