how to draw a rect that doesn't disappear

there is my code,
hook.Add(“HUDPaint”,“DrawMyHud”,function ( )

surface.SetDrawColor( 255, 255, 255, 255 )
surface.DrawRect( 25, 25, 100, 100 )

end)

the question is when i press ESC , the rect i drawed will disappear, how can i draw a rect that doesn’t disappear?
thank you

HUDPaint isn’t called when the (default) escape menu is open.

GM:PostRenderVGUI
or

GM:PostDrawHUD
or

GM:DrawOverlay

you can’t just give a monkey a paper & pencil and expect them to know how to write…

thank you very much