Restive Posted August 16, 2023 Posted August 16, 2023 Hello guys, I'm wondering how to create a "blur" on the whole screen? I know there is a resource https://wiki.multitheftauto.com/wiki/Resource:Blur_box but i don't know how to use it. Is it possible to create without gui? Just blur only.
AngelAlpha Posted August 16, 2023 Posted August 16, 2023 local sx, sy = guiGetScreenSize() exports.blur_box:createBlurBox( 0, 0, sx, sy, 255, 255, 255, 255, false ) 1
Restive Posted August 17, 2023 Author Posted August 17, 2023 18 hours ago, AngelAlpha said: local sx, sy = guiGetScreenSize() exports.blur_box:createBlurBox( 0, 0, sx, sy, 255, 255, 255, 255, false ) Hi, thanks for reply. I have little problem with destroying blur box. What I did wrong in code? addEventHandler("onClientRender", root, function() local sx, sy = guiGetScreenSize() blur = exports.blur_box:createBlurBox( 0, 0, sx, sy, 255, 255, 255, 255, false ) blur = exports.blur_box:setBlurIntensity(3) end) addEventHandler("onClientResourceStop", root, function () exports.blur_box:destroyBlurBox(blur) removeEventHandler('onClientRender', root function()) end)
MIKI785 Posted August 18, 2023 Posted August 18, 2023 As far as I understand from reading the wiki, it creates a GUI element. This means that you are to treat it as any other GUI element, not like dx functions. Basically, there's no need to render it yourself using onClientRender -> the resource does that for you. So, what your code does is that it's creating a new GUI element on every render, that's why you're not able to destroy it. You're only storing the latest instance of that GUI element inside of the blur variable. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now