- Home /
Creating a bar/line graph in a window. Box not drawn 1-pixel thick.
I am using the following line of code to draw the graph lines and the plot lines for my graph. I specify the rectangle to be drawn with a height of 1 pixel in order to make it line-like. When I run the code though the Boxes are very thick (look at horizontal graph lines). I'd like to force the boxes to be as thick as a line would be.
GUI.Box(new Rect(100, 30 * graphDraw + 40, GraphWindow.width - 300, 1), "");
Also, it's difficult to see in the picture however going through the centers of each of the boxes looks like the correct, 1-pixel tall, line. I'm not sure what this signifies.
I'd also like to add that I tried putting decimal heights smaller than 1 for the height of the Rect which does nothing.
Answer by Graham-Dunnett · Jul 03, 2013 at 09:39 PM
Probably need to look at the `GUIStyle` used for the box. If you recall, GUIStyles
include padding, margin and borders, so I'd guess that one of those is making your boxes bigger.
Your answer
Follow this Question
Related Questions
Wraping text to fit in a gui box 1 Answer
Buttons in Rects, opening other Rects? 2 Answers
How can I use Rect.Contains with GUI.Window? 1 Answer
3d object button with a pop up window 0 Answers
Rotating a Rect by the GUI.matrix? 0 Answers