how to materalise a "draw.RoundedBox"

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

//Thanks

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.

[LUA]
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
end)
[/LUA]

[SP] OMG OMG OMG I TIHNK I JSUT MAEK AB OW DRWA !!! [/SP]

: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

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Surface.DrawTexturedRect)**

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

[editline]02:13PM[/editline]

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 )

[editline]07:48PM[/editline]

in garrysmod

[editline]08:03PM[/editline]

getting on well :

[LUA]

local PANEL={}

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

function PANEL:Paint()
draw.RoundedBox(6,0,0,self:GetWide(),self:GetTall(),Color(255,255,255,255));
for X,tab in pairs( self.PrimeBase ) do
for Y,color in pairs( tab ) do
draw.RoundedBox(2,X,Y,5,5,color);
end;
end;
return true;
end;

function PANEL:Painted()
return self.PrimeBase;
end;

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

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

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

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 );
end;

vgui.Register( “DPaint”, PANEL );
[/LUA]

don’t steal code, not finished yet

Too late I already stole it.

Try this op: