Garry's Mod Wiki

GM:PreDrawHUD

GM:PreDrawHUD()

Description

Called just after GM:PostDrawEffects. Drawing anything in it seems to work incorrectly.

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

Example

Allows you to draw something before any other HUD elements.

local clr = Color(20, 20, 20, 200) hook.Add("PreDrawHUD", "PreDrawExample", function() cam.Start2D() -- If you don't call this the drawing will not work properly. surface.SetDrawColor(clr) surface.DrawRect(0, 0, ScrW(), ScrH()) cam.End2D() end)

Page Links


Special Pages


Wikis

?

Render Time: 30ms

DB GetPage 3
Generate Html 1
SaveChanges (1) 11
Render Body 0
Render Sidebar 12