How to make a Rounded Outlined/Textured Box?

Hey guys, I have a quick question to ask.

How would I make a rounded outlined or textured box? So it would fit with draw.RoundedBox, or other stuff.
Simple as that.

Thanks!

For rounded outlined - draw a bigger box as an outline and a smaller box as the actual box.

For textured box you’ll have to use surface library


local mytexture = Material("bleh")
function draw()
surface.SetMaterial(mytexture)
surface.SetDrawColor( color_white )
surface.DrawTexturedRect( 0, 0, 100, 100 )
end

I meant rounded textured box. I knew about the normal textured box.
But thanks for the rounded outlined tip.

I don’t think that’s possible. What rounded box is 4 textured rects for corners and 3 more for the inside.

It might be possible with stencils, but I’m not completely sure about that.
It would just be better to have your texture pre-defined to the shape of the rounded rect.

You could also abuse the awesomomium control and do it with html. Not sure that’d be awesome performance wise, but it’d still be simpler than the stencil method.

**[Surface.DrawPoly

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/page/surface/DrawPoly)**

Just a word of advice too:
[lua]
surface.GetTextureID( “” )
Material( “” )
[/lua]
Should be called OUTSIDE of the HUDPaint hook. If it isn’t it’s going to cause quite a bit of performance issues.

Afterwards, you’re free to call the variable for SetMaterial/SetTexture inside the HUDPaint.