Polygons HUD

I have a question: I want to make in-game a box or call it how you want.


I think I should use polygons but I can’t find anything about how to make polygons in gmod.
And another thing is how to make something like that, could anyone give me a simple example ?

And I know I’m not an artist so excuse my image.

While I’m no professional at HUD’s (because I don’t touch them)

^ That might work?

It would be cheaper and easier to just use a texture with surface.DrawTexturedRect.

Agreed, for that particular shape a texturedrect is better. Why? DrawPoly can indeed be optimized, making a table once and doing a single drawpoly is simple and efficent. Though, for that shape, it requires quite a few coordinates. I’ve found DrawPoly to be only useful for skewed/distorted perspective rectangles, like the new FPS games have health bars that are skewed.

[editline]1st March 2013[/editline]

DrawPoly’s are also useful when you don’t have a defined set of coordinates. For example with drawpoly i would imagine it being useful if you want to make a script where a triangle turns into a rectangle, then pentagon, then hexagon etc. Well basically if you are planning to do something that would require a ton of textures but could be done a lot easier by adding coords.