Garry's Mod Wiki

GM:HUDPaintBackground

  GM:HUDPaintBackground()

Description

Called before GM:HUDPaint when the HUD background is being drawn.

Just like GM:HUDPaint, this hook will not be called when the main menu is visible. GM:PostDrawHUD does not have this behavior.

Things rendered in this hook will always appear behind things rendered in GM:HUDPaint.

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, behind all other HUD elements.

hook.Add( "HUDPaintBackground", "HUDPaintBackground_DrawABox", function() surface.SetDrawColor( 0, 0, 0, 128 ) surface.DrawRect( 50, 50, 128, 128 ) end )