PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

BackgroundTransparency

GuiObject

float

This property determines the transparency of the GuiObject|GUI's background and border.

It does not, however, determine the transparency of text if the GUI is a Textbox, TextButton, or TextLabel. Text transparency is determined TextBox/TextTransparency|, TextButton/TextTransparency, and TextLabel/TextTransparency respectively.

If the property is set to 1, neither the background nor the border will render and the GUI will be completely transparent.


Code Samples


Flash Fade a Gui Element

The example below demonstrates how to continuously fade a GUI element in and out (see image below). It relies on the RenderService|RenderService's RenderService/RenderStepped event to update and render the element’s GuiObject/BackgroundTransparency every frame.

The GUI element fades in and out between the maximum transparency value, MAX_TRANSPARENCY, and minimum transparency value, MIN_TRANSPARENCY. It uses the delta variable to determine what amount to change the element’s BackgroundTransparency.

This example should work as expected when placed in a Script or LocalScript that is the child of the GUI element you want to fade in and out.

GUI Element Fading In and Out