Is there any way to draw a polygon on GUI? I’m trying to draw a pentagon.
One method is to create a Texture2D at runtime and fill in the pixels as you see sit; in your case to create a pentagon.
You can then use GUI.DrawTexture to render it.
ps I know this is an old thread but I had the same question and this link ranks high on google. Hence my publishing the solution I went with.
Some ideas
=> How about use render target feature to implement 3D polygon rendering on 2D GUI ?
=> First you draw any mesh you need to a camera render target.
=> Then you set the 2D GUI texture as the camera render target.
This approach allow you render any 3D scene onto any 2D sprite.
1 Like