#GUI Blur Box

1 messages · Page 1 of 1 (latest)

dreamy arch
#

The required script

blur_box

Panelin olduğu scriptin metasında clienti en üstte olan herhangi bir yere yapıştırın.

In the meta of the script where the panel is located, the client is located anywhere at the top.

local blurBoxTables = {}
local blurBoxExport = exports.blur_box

--relativeVisible
local sx,sy = guiGetScreenSize()
function relativeto(x1,x2)
    return sx *x1, sy*x2
end
function torelative(x1,x2)
    return x1/sx,x2/sy
end

blurBoxExport:setBlurIntensity(2)
Mahlib_State = true


--blur postion set x,y,w and h
addEventHandler( "onClientPreRender", root,
    function()
        for i,data in pairs(blurBoxTables) do 
           if data.visible then 
                local xPos, yPos = guiGetPosition ( data.guiElm , data.relative )
                local xSize, ySize = guiGetSize ( data.guiElm , data.relative )
                if data.relative then 
                    blurBoxExport:setBlurBoxPosition( data.blurElm, relativeto(xPos, yPos) )
                    blurBoxExport:setBlurBoxSize( data.blurElm, relativeto(xSize, ySize) )    
                else
                    blurBoxExport:setBlurBoxPosition( data.blurElm, xPos, yPos )
                    blurBoxExport:setBlurBoxSize( data.blurElm, xSize, ySize )    
                end
           end
        end

    end
,true ,"high-3" )    

_guiCreateWindow = guiCreateWindow 
function guiCreateWindow(x,y,w,h,text,relative)
    local guiElm = _guiCreateWindow(x,y,w,h,text,relative)
    --guiSetAlpha(guiElm,0.3)
    if relative then 
        blurBoxTables[guiElm] = {
            blurElm = blurBoxExport:createBlurBox( relativeto(x,y),relativeto(w,h), 255, 255, 255, 255, false ),
            guiElm = guiElm,
            visible = true,
            relative = relative,
        }
    else
        blurBoxTables[guiElm] = {
            blurElm = blurBoxExport:createBlurBox( x,y,w,h, 255, 255, 255, 255, false ),
            guiElm = guiElm,
            visible = true,
            relative = relative,
        }
    end
    --Control Mahlib State
    if Mahlib_State then 
        addEvent("MahLib:PencereKapatıldı",true)
        addEventHandler("MahLib:PencereKapatıldı",guiElm,function ()
            if blurBoxTables[source] then 
                blurBoxExport:setBlurBoxEnabled(blurBoxTables[source].blurElm,guiGetVisible(source))
                blurBoxTables[source].visible = state
            end
        end)
    end

    return guiElm
end


--destroy gui window and destroy blur
_destroyElement = destroyElement
function destroyElement(elm)
    if blurBoxTables[elm] then 
        blurBoxExport:destroyBlurBox( blurBoxTables[elm].blurElm )
        blurBoxTables[elm] = nil

    end
    return _destroyElement(elm)
end


--blurs visible
_guiSetVisible = guiSetVisible
function guiSetVisible(elm,state)
    if blurBoxTables[elm] then 
        blurBoxExport:setBlurBoxEnabled(blurBoxTables[elm].blurElm,state)
        blurBoxTables[elm].visible = state
    end
    return _guiSetVisible(elm,state)

end

--source stop destroy all blurs
addEventHandler( "onClientResourceStop", getResourceRootElement( getThisResource()),
function()
    for i,data in pairs(blurBoxTables) do 
       blurBoxExport:destroyBlurBox( data.blurElm )
    end
end
)
wicked shadow
#

elıne sağlık