Garry's Mod Wiki

surface.DrawOutlinedRect

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

Description

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.

Arguments

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 = 1
The thickness of the outlined box border.

Example

Draws a 100x100 outlined rectangle in top left corner of which the outline thickness pulses from 5 to 15 indefinitely.

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 )