Garry's Mod Wiki

GM:HUDPaint

  GM:HUDPaint()

Description

Called whenever the HUD should be drawn.

This is the ideal place to draw custom HUD elements.

To prevent the default game HUD from drawing, use GM:HUDShouldDraw.

This hook does not get called when the Camera SWEP is held, or when the esc menu is open.
If you need to draw in those situations, use GM:DrawOverlay instead.

This is a rendering hook which provides a 2d rendering context.

Example

Draws a transparent black box in the top left corner of the screen.

hook.Add( "HUDPaint", "HUDPaint_DrawABox", function() surface.SetDrawColor( 0, 0, 0, 128 ) surface.DrawRect( 50, 50, 128, 128 ) end )