Was looking for a module to help stylize my GUI with foreground blur, but couldn’t find anything that supported UICorners or Padding, made this whole module within a couple of hours and thought that maybe somebody might want to use this for their own experience without having to waste time making one.
Links (Hopefully they work)
The Module on Marketplace
How to use:
Once the module has been required (Preferably from a LocalScript within PlayerScripts) it will instantly initiate.
Adding Blur to a GuiObject
:
By using the method :AddBlur(UI: GuiObject, Padding: number)
you can instance a BlurObject that will be directly linked to the specified UI
with a specified amount of Padding
(In pixels).
Automatically adding Blur to a GuiObject
or ScreenGui
:
By using the method :AddBlurToInstance(Screen: Instance, Padding: number, NamePattern: string, Consistent: boolean):
you can instance multiple BlurObjects at the same time into all objects that descend from Screen
that contains the NamePattern
within their instances name. If the object you are trying to instance into has a GUI that loads and unloads, try setting the Consistent
parameter to true
so that it will constantly watch for new GUI that gets Parented.
Automatically and Consistantly adding Blur to a ScreenGui (Helpful for ScreenGui that have ResetOnSpawn enabled):
Similar to the method :AddBlurToInstance
, the method :AddBlurToScreenGui(ScreenName: string, Padding: number, NamePattern: string, Consistent: boolean)
will consistently add BlurObjects to a Specified ScreenName
, a reference to a ScreenGui’s consistent name when parented to a player PlayerGui
. Consider setting the Consistent
parameter to true
if your ScreenGui isn’t already loaded before being parented.
Removing Blur from a GuiObject
:
By using the method :RemoveBlur(UI: GuiBase)
you can completely remove a BlurObject from memory just by setting a reference UI
that has been previously instanced.
All BlurObjects are immediately removed upon its reference GUI’s removal
Disclaimers
- Have not done much testing outside of my current workflow, feel free to reply with any questions or issues you’ve had with this module.
- Have not tried testing with ScrollingGui’s.
- GuiObject Rotation has not yet been implemented, nor might never be.
Performance:
Even after linking 256 GUI’s, there didn’t seem to be any noticeable performance drops at all.
With a single BlurObject:
With two hundred and fifty-six BlurObject’s:
I apologize if none of this makes sense it is currently 4 AM and I need to get to sleep, good night.