Class · inherits LayerCollector
ScreenGui
Primary container of on-screen 2D user interface elements.
About ScreenGui
ScreenGui is a storage container for 2D GuiObjects
displayed on the user's screen. A ScreenGui only shows if parented to
a player's PlayerGui; parenting a ScreenGui to
StarterGui ensures it clones into each player's PlayerGui when
they join the experience and their character first spawns. See
On‑Screen UI Containers for further
details.
For performance improvements, the appearance of a ScreenGui is cached
until one of the following events occurs:
- A descendant is added to or removed from it.
- A property of a descendant changes.
- A property of the
ScreenGuiitself changes.
If any of these events occur, the ScreenGui appearance is recomputed
on the next frame it gets rendered.
Properties 5
ClipToDeviceSafeArea
: booleanWhether to clip the contents of thisScreenGuito the device's safe area.If this property is
true, allGuiObjectdescendants of theScreenGuiwill be clipped to the device's safe area (seeScreenInsets). The default istrueto maintain backwards compatibility of UI that is intentionally hidden offscreen, such as objects that slide into view from a screen edge when they're needed.If this property is
false,GuiObjectdescendants will not be clipped to the device's safe area and may be obscured by the camera notch or other screen cutouts.Note that this property will be ignored if you set
ScreenInsetstoNone, as doing so implies that you intentionally want to disregard the device's safe insets.DisplayOrder
: intControls the Z-index order in which multipleScreenGuicontainers are drawn.This property controls the Z-index order in which multiple
ScreenGuicontainers are drawn. Those with a higherDisplayOrderwill be drawn on top of those with a lower value.IgnoreGuiInset
: booleanNotReplicatedDetermines whether theScreenGuioverflows into the range of Roblox's core UI elements.If this property is
false(default),ScreenInsetsis set toCoreUISafeInsets, effectively keeping its bounds below the Roblox top bar core UI.If this property is changed to
trueandScreenInsetsis currently set toCoreUISafeInsets,ScreenInsetswill be set toDeviceSafeInsets.See
ScreenInsetsfor details on how screen insets affect the contents of aScreenGui.SafeAreaCompatibility
: SafeAreaCompatibilitySpecifies whether automatic UI compatibility transformations are applied to descendant "fullscreen"GuiObjectson displays with screen cutouts.This property specifies whether automatic UI compatibility transformations are applied to descendant "fullscreen"
GuiObjectsof theScreenGuion displays with screen cutouts. Eligibility occurs if the total area of the descendantGuiObject(including any applied border orUIStroke) covers the device's safe area both horizontally and vertically. See theSafeAreaCompatibilityenum reference for details.The default value is
FullscreenExtensionin order to automatically improve the appearance of UI that was authored for screens without any cutouts. However, it's recommended that you avoid fullscreen extensions for new work; instead, use theScreenInsetsproperty to specify which insets should be respected for differentScreenGuicontainers.Note that descendant UI objects will continue to be clipped by the device's safe area if
ClipToDeviceSafeAreais set totrue.ScreenInsets
: ScreenInsetsControls the safe area insets that are applied to the contents of theScreenGui.This property controls the safe area insets that are applied to the contents of the
ScreenGui.The default of
CoreUISafeInsetskeeps all descendantGuiObjectsinside the core UI safe area, clear of the Roblox top bar buttons and other screen cutouts like the device's camera notch.If you set this property to
None, UI objects may be obscured behind core UI objects or device cutouts like the camera notch. As a result, you should only useNonefor aScreenGuithat contains noninteractive content like background images.See On-Screen UI Containers for alternative examples.
ScreenGui also has every member of LayerCollector. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.