Garry's Mod Wiki


  surface.DrawOutlinedRect( number x, number y, number w, number h, number thickness )


Draws a hollow box with a given border width.

This is a rendering function that requires a 2d rendering context.

This means that it will only work in 2d Rendering Hooks.


1 number x
The start x integer coordinate.
2 number y
The start y integer coordinate.
3 number w
The integer width.
4 number h
The integer height.
5 number thickness
The thickness of the outlined box border.


Draws a 100x100 outlined rectangle in top left corner.

hook.Add( "HUDPaint", "DrawOutlinedRect", function() surface.SetDrawColor( 255, 255, 255, 128 ) surface.DrawOutlinedRect( 25, 25, 100, 100, math.floor( math.sin( CurTime() * 5 ) * 5 ) + 10 ) end )