ScreenGui

ScreenGui : LayerCollector

Overview

ScreenGui is a container holding 2D UI elements (GuiObject) displayed on user screen. For these elements to be actually displayed, ScreenGui must be placed in playerโ€™s PlayerGui. If it is placed in StarterGui, it is automatically replicated to each playerโ€™s PlayerGui when a player enters the game and a character is created for the first time.

ScreenGui may contain a variety of child UI elements such as Frame, TextLabel, and ImageButton.

In addition, ScreenGui internally caches rendering results and reuse them when there are no changes to optimize performance. However, if the properties of ScreenGui itself are changed, the properties of child elements are changed, or child elements are added or removed, the screen information is recalculated in the next rendering frame.

ScreenGui can be controlled only in client environment.

Properties

DisplayOrder

number

Defines the overlapping order when multiple ScreenGuis are simultaneously displayed on screen. A ScreenGui with a higher DisplayOrder value is placed forward than a ScreenGui with a lower DisplayOrder, so it can visually form a more forward layer.

Code Samples

local ScreenGui = script.Parent

ScreenGui.DisplayOrder = 2

Methods

Events

See aslo

GUI

Last updated