• Blurring a Panel
    1 replies, posted
Hello, I am new to lua and had the unoriginal idea of making a MOTD with a blurred base texture. I'm not sure if this is possible but it would be much obliged if you could help me out in one way or the other. [highlight](User was banned for this post ("DEVELOPER DISCUSSION" - NiandraLades))[/highlight]
[CODE]local blur = Material('pp/blurscreen') local function draw_Blur(panel, amount) local x, y = panel:LocalToScreen( 0, 0 ) local scrW, scrH = ScrW(), ScrH() surface.SetDrawColor( 255, 255, 255 ) surface.SetMaterial( blur ) for i = 1, 6 do blur:SetFloat('$blur', (i / 6) * (amount ~= nil and amount or 6)) blur:Recompute() render.UpdateScreenEffectTexture() surface.DrawTexturedRect(x * -1, y * -1, scrW, scrH) end end local egFrame = vgui.Create( "DFrame" ) egFrame:SetPos( 100, 100 ) egFrame:SetSize( 300, 300 ) egFrame:SetTitle( "Blur Example" ) egFrame:MakePopup() egFrame.Paint = function( self, w, h ) draw_Blur( self, 5 ) draw.RoundedBox( 0, 0, 0, self:GetWide(), self:GetTall(), Color( 0, 0, 0, 220 ) ) end[/CODE]
Sorry, you need to Log In to post a reply to this thread.