Hud outline

How can i make outlines of different colors on draw.rounded box

If you’re wanting to just draw a 1px thick outline, you can use surface.DrawOutlinedRect http://wiki.garrysmod.com/page/surface/DrawOutlinedRect

To set it’s color prior to drawing it, you can do something like the following:



local x, y = ScrW() / 2, ScrH() / 2
local w, h = 100, 100

draw.RoundedBox( 0, x, y, w, h, Color( 0, 0, 0 ) ) -- the inner black box

surface.SetDrawColor( Color( 255, 0, 0 ) ) -- set the outline's color
surface.DrawOutlinedRect( x, y, w, h ) -- draw the outline


If you are still set on using draw.RoundedBox or want to create a thicker border more easily, you can use two RoundedBoxes and make the one on top smaller than the outer one.

For example, to create a 3px thick red outline, you can do something like:



local x, y = ScrW() / 2, ScrH() / 2
local w, h = 100, 100

draw.RoundedBox( 0,   x,   y,     w,     h, Color( 255, 0, 0 ) )
draw.RoundedBox( 0, x+3, y+3, w - 6, h - 6, Color(   0, 0, 0 ) )

You could try this as well,
http://forum.facepunch.com/showthread.php?t=833294&p=17961794&viewfull=1#post17961794