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

[lua]
function BlackoutHUD()
surface.SetDrawColor( 0, 0, 0, 255)
surface.DrawRect(0 , 0, ScrW(), ScrH() )
end

hook.Add(“HUDPaint”, “BlackoutHUD”, BlackoutHUD)
[/lua]

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…

Odd.

[lua]
poop = vgui.Create(“DPanel”)
poop:SetPos(0,0)
poop:SetSize(ScrW(),ScrH())
poop.Paint = function()
draw.RoundedBox(0,0,0,ScrW(),ScrH(),Color(0,0,0,255))
end[/lua]

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:
[lua]
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 )
end

function ClapOnClapOff()
if !(OmgBoolean) then
hook.Add( “RenderScreenspaceEffects”, “ClapOnClapOff”, blackage )
else
hook.Remove( “RenderScreenspaceEffects”, “ClapOnClapOff”)
end
OmgBoolean = !(OmgBoolean)
end
concommand.Add(“Clap”,ClapOnClapOff)
[/lua]

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