- Home /
 
Change colour of GUI box, keep round corners.
I am making a health bar and am using:
GUI.box(new Rect(1, 1, hpBarSize.x * playerHealth - 2, hpBarSize.y -2), "", style);
I changed the style and the colour to red, and it looks okay: 
The problem is: the texture is square. The rounded borders are, well... rounded. Anything I can do to go around this?
Code for generating texture:
         Color drawColor = new Color(r, g, b);
 
         for (int y = 0; y < hpTexture.height; ++y)
         {
             for (int x = 0; x < hpTexture.width; ++x)
             {
                 hpTexture.SetPixel(x, y, drawColor);
             }
         }
 
         hpTexture.Apply();
 
              
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
how to make scroll box in the combo box? 1 Answer
C# Multiple GUI.Tooltips 2 Answers
Getting Debug log errors when I load my scenes 2 Answers
Multiple Cars not working 1 Answer