Put an Overlay on Screen

For my afk system I would like to make a slightly see through overlay that covers the players whole screen with big red text in the middle but I am not sure if I would use derma or another way, it can’t have focus because there are many hooks that will need to hide it such as keyreleased.

Sounds pretty simple to make. What does the text have to say? It could just be an image.

Just wanted giant afk text in red.



hook.Add("HUDPaint", "AFKPAINT", function()
surface.CreateFont( "Arial", 21, 500, true, false, "MYFONT" )
surface.SetFont( "MYFONT" )
draw.SimpleText("AFK", "MYFONT", ScrW() / 2 - 100, ScrH() - 70, Color(255,0,0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end)


This could work, I haven’t tested it yet.

Bad bad bad. Never create a font ever frame >_<

http://img24.imageshack.us/img24/480/afk1689550.jpg

[lua]
hook.Add(“HUDPaint”, “AFKPAINT”, function()
surface.SetFont( “HUDNumber5” )
surface.SetDrawColor(0,0,0,230)
surface.DrawRect(0,0,ScrW(),ScrH())
surface.SetTextColor(184,52,54,255)
local w,h = surface.GetTextSize(“You are currently AFK”)
surface.SetTextPos((ScrW()/2)-(w/2),(ScrH()/2)-(h/2))
surface.DrawText(“You are currently AFK”)
surface.SetTextColor( 200, 200, 200, 255 )
end)
[/lua]
Just for you

Ooops, I didn’t realise I did that, haha, but you do need to create a font, because of:

So you can scale the text size bigger.

Hey nice key

Aha

/inside joke