1
Support / Re: Round corners
« on: April 14, 2014, 11:59:58 pm »
Ok so I finally went with the solution of importing a quarter circular object from Cinema4D, which I used for the top left and top right corner. Then I simply changed the offset of the corner material based on the width of the object.
Then wrote my own simple sliced sprite script and done. Still, a lot of work for just round corners haha
Code: [Select]
float textureWidth = middle.renderer.sharedMaterial.mainTexture.width;
float offsetX = -0.5f + (middle.localScale.x % textureWidth) / textureWidth;
corner.renderer.material.mainTextureOffset = new Vector2 (offsetX, -1);
Then wrote my own simple sliced sprite script and done. Still, a lot of work for just round corners haha