RoundedBox Blur


I need some help over here. I saw a thread that was related to this but still could not figure it out.
I have this code to a blur RoundedBox and i want to use it on cordinates that i got here from my HUD.

 	draw.RoundedBox( 18, 790, ScrH() - 70, 360 * hp, 40, Color( 224, 255, 255)) -- Health Bar 

I want to put another draw.RoundedBox under it and want to make it a blur material.

local blur = Material("pp/blurscreen")
local function DrawBlurRect(x, y, w, h)
	local X, Y = 0,0


	for i = 1, 5 do
		blur:SetFloat("$blur", (i / 3) * (5))


		render.SetScissorRect(x, y, x+w, y+h, true)
			surface.DrawTexturedRect(X * -1, Y * -1, scrW, scrH)
		render.SetScissorRect(0, 0, 0, 0, false)

Can someone help me to were i put the cordinates?
Thank you :slight_smile:

Can you look my post first please… i already have the code but don’t know where to put the cordinates…
I have the cordinates in my thread

Sorry. I was only posting that because your code doesn’t draw a rounded blurred box, it draws a box without rounded edges with blurring, but then I checked and the link I posted does the exact same thing.

Anyway, the coordinates are literally exactly the same thing:

DrawBlurRect( 790, ScrH() - 70, 360 * hp, 40 )
draw.RoundedBox( 18, 790, ScrH() - 70, 360 * hp, 40, Color( 224, 255, 255 ) )

[editline]29th August 2017[/editline]

The wiki page shows RoundedBox as this:

draw.RoundedBox( number cornerRadius, number x, number y, number width, number height, table color )

So for DrawBlurRect the only difference is no cornerRadius argument (because as I said before, it doesn’t actually draw a rounded box at all), and no color argument:

DrawBlurRect( number x, number y, number width, number height )

Thank dude! Appreciated it!

[editline]29th August 2017[/editline]

One problem tho…
It keeps saying its a nill value:

[ERROR] lua/autorun/client/cl_hud.lua:51: attempt to call global 'DrawBlurRect' (a nil value)
  1. v - lua/autorun/client/cl_hud.lua:51
   2. unknown - lua/includes/modules/hook.lua:84

You need the actual function. It can’t call a function you never put in the code. That’s pretty self explanatory. Just put the actual function before everything and it should work.

Okay, thank you!