Any good way to blacken the screen?

I’m working on a menu for players connecting to my server but i need to hide the entire screen, for now i’m using a

function BlackoutHUD()
surface.SetDrawColor( 0, 0, 0, 255)
surface.DrawRect(0 , 0, ScrW(), ScrH() )

hook.Add(“HUDPaint”, “BlackoutHUD”, BlackoutHUD)

however my problem is that if you hit esc to go back in the gmod main menu, the screen in the background doesn’t stay black, is there a better way?

Also any way to prevent derma menus to show OVER the main gmod interface when you hit esc?

Look at the Prop Hunt code.

It appear they use the very same code i use, excepted in my case it doesn’t work if you hit esc…


poop = vgui.Create(“DPanel”)
poop.Paint = function()

Something like that.

Btw. When they hit esc, nothing will show up. shrug so make sure not to test it unless you have a way to remove it :stuck_out_tongue_winking_eye:

Yeah i thought about this but that’s a bit … borderline annoying, is there something like a command to… i dunno , set brightness to 0 maybe?

post processing, possibly?

Sorry, didn’t read that you didn’t want derma :stuck_out_tongue: Here’s something I wrote up real quick:
local Sup = {}
Sup[ “$pp_colour_addr” ] = 0
Sup[ “$pp_colour_addg” ] = 0
Sup[ “$pp_colour_addb” ] = 0
Sup[ “$pp_colour_brightness” ] = 0
Sup[ “$pp_colour_contrast” ] = 0
Sup[ “$pp_colour_colour” ] = 0
Sup[ “$pp_colour_mulr” ] = 0
Sup[ “$pp_colour_mulg” ] = 0
Sup[ “$pp_colour_mulb” ] = 0

OmgBoolean = false

function blackage()
DrawColorModify( Sup )

function ClapOnClapOff()
if !(OmgBoolean) then
hook.Add( “RenderScreenspaceEffects”, “ClapOnClapOff”, blackage )
hook.Remove( “RenderScreenspaceEffects”, “ClapOnClapOff”)
OmgBoolean = !(OmgBoolean)

Typing clap in console will make your screen black, or normal. Fun stuff. Virtual Clap On Clap Off!

This is just great :slight_smile: Many thanks!

Thank you for the code