how to materalise a "draw.RoundedBox"

how do i materlise a draw.RoundedBox ? <— first attemp
how do i materialise a draw.roundedbox ? <---- final attemp


Can you please explain to use what you mean. Materalise is not found in my dictionary.

Oh come on. I thought it was pretty obvious that he wants to draw a textured rounded box.

Actually I shouldn’t have posted because I have no idea how to do that. :v: Anyone?

It’s probably possible with stencils, but that might not be the best solution around.

I did have a look earlier, no idea why i didnt reply, and i don’t know either :question:

Does it have to be a rounded box? Can you not just edit the texture to have rounded edges?

Genius… pure genius.

As far as i know it’s not possible to texture a rounded box.

exactly D= , i know my english is like a … un-explainable thing.

hook.Add( ‘PaintHUD’ /* or something like that */, ‘RaNDoM NamE’, function()
// draw mah box right round round round right round!
// lolzy that was easy
// if you didnt know the answer, dont post


:slight_smile: i think that should do it

Fail… One It’s HUDPaint. And I’m pretty sure he can draw a NORMAL roundbox, he want one with a texture in…

ima talking about a textured roundbox X(

You can’t texture a rounded box, You’ll just have to use draw.TexturedRect

well, how do i do that?, i cant find it in the wiki :confused:

Okay, screw it, drawing a rounded box on a stencil definitely does not work.
Your best bet is probably to make a material that looks like a rounded box.

If you’re not trolling on purpose, I find you quite depressing.

Had the function name wrong it’s: **[Surface.DrawTexturedRect](**

well, do you know how to draw a material?, well i can take a look on wiki if u duno.


oh thank you, im going to try it.

You OBIVOUSLY didn’t read my code, or what i commented in it. Next to the place where you decide what your hooking into , i placed a comment saying ‘Or something like that’ so please actually read what i post befor plamming me. And also you cant curve a texture without the gm_image

You can make it curved when you makezor it though :v:

Yes XD , but in the source engine i am talking about. Hey, why not have someone make a paint program ( i gots an idea, so i might as well )


in garrysmod


getting on well :


local PANEL={}

function PANEL:Init()
self.PrimeBase = { }

function PANEL:Paint()
for X,tab in pairs( self.PrimeBase ) do
for Y,color in pairs( tab ) do
return true;

function PANEL:Painted()
return self.PrimeBase;

function PANEL:SetPainted( tab )
self.PrimeBase = tab

function PANEL:SaveImage( dir )
file.Write( dir…’.txt’ , util.TableToKeyValues(self.PrimeBase ));

function PANEL:LoadImage( dir )
self:SetPainted( util.KeyValuesToTable(file.Read( dir ) ) );

function PANEL:OnMousePressed()
local x, y = gui.MousePos();
if !self.PrimeBase[ x ] then self.PrimeBase[ x ] = { } end;
self.PrimeBase[ x ][ y ] = Color( 255, 0, 0, 255 );

vgui.Register( “DPaint”, PANEL );

don’t steal code, not finished yet

Too late I already stole it.

Try this op: