title: How to set up UVs for Texture borders
body: <p>I'm generating a plane that is able to scale without the edges of the texture being affected pixel wise. The plane needs to be able to keep its border proportion but be able to stretch to almost any size. The mesh has 8 vertices and 10 triangles to make the border. Anyway here is what I get. Ignore the numbers on the mesh geometry.</p>
  
  <p><img src="https://i.stack.imgur.com/53LWx.jpg" alt="enter image description here"></p>
  
  <p>Is it possible to edit the UVs so that I get the Desired result?
  here's the code:</p>
  
  <pre><code>Mesh mesh = new Mesh();
      var renderer = mesh.AddRenderer();
  
  
      //create verticies
  
      mesh.vertices = new Vector3[] {
  
          //vertices in order for convienience 
          Manager.GUI.ScreenToWorldPoint(new Vector3(0f,0f,0f)),                            //0
          Manager.GUI.ScreenToWorldPoint(new Vector3(padding,padding,0)),                   //1
          Manager.GUI.ScreenToWorldPoint(new Vector3(width - padding, padding,0f)),         //2
          Manager.GUI.ScreenToWorldPoint(new Vector3(width,0f,0f)),                         //3
          Manager.GUI.ScreenToWorldPoint(new Vector3(width - padding, height - padding,0f)),//4
          Manager.GUI.ScreenToWorldPoint(new Vector3(width,height,0f)),                     //5
          Manager.GUI.ScreenToWorldPoint(new Vector3(padding, height - padding, 0f)),       //6
          Manager.GUI.ScreenToWorldPoint(new Vector3(0f,height,0f)),                        //7
      };
  
  
  
      //create triangles
      mesh.triangles = new int[] {
          7,5,6,
          6,5,4,
          4,5,3,
          2,4,3,
          0,2,3,
          0,1,2,
          0,7,6,
          0,6,1,
          1,6,4,
          1,4,2
  };
  
      //create UV's uvs are in order of creation for convienience
         mesh.uv = new Vector2[] {
             new Vector2(0f,0f),
             new Vector2(padding/width, padding/height),
             new Vector2((width-padding)/width, padding/height),
             new Vector2(1f,0f),
             new Vector2((width - padding)/width,(height-padding)/height),
             new Vector2(1f,1f),
             new Vector2(padding/width,(height-padding)/height),
             new Vector2(0f,1f)
  
  
  
  
  
      };
  
  
  
      mesh.calculateNormals();
      mesh.calculateBounds();
      renderer.Texture = mytex;
      return plane;
  }
  </code></pre>
  
  <p>Padding is the defined pixels around the the texture that ignores scaling, while height and width are the dimensions of the shape.</p>