ScreenGui
Contains a screen-space interface for one player.
- Creatable
Instance.new("ScreenGui")- Inherits
- GuiLayerCollectorGuiBase2dGuiBaseInstance
- Replication
- Standard
Behavior
ScreenGui contains GUI instances rendered for one player. Parent it to that
player's PlayerGui. Templates in
StarterGui are copied into PlayerGui on spawn.
Summary
The draw order of this ScreenGui relative to other interface roots.
Whether the screen and its descendants are rendered.
Whether layout ignores screen space reserved by the engine interface.
Whether the screen is deleted and recreated on respawn.
Returns this instance if it is an ExecutionGroup.
Properties
DisplayOrder
ScreenGui.DisplayOrder: number = 0The draw order of this ScreenGui relative to other interface roots.
Enabled
ScreenGui.Enabled: boolean = trueWhether the screen and its descendants are rendered.
IgnoreGuiInset
ScreenGui.IgnoreGuiInset: boolean = falseWhether layout ignores screen space reserved by the engine interface.
ResetOnSpawn
ScreenGui.ResetOnSpawn: boolean = trueWhether the screen is deleted and recreated on respawn. Set to false to preserve the screen. References to a replaced screen must be reacquired.
Methods
GetExecutionGroup
ScreenGui:GetExecutionGroup(): ExecutionGroup?Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying
Example
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local screen = Instance.new("ScreenGui")
screen.ResetOnSpawn = false
screen.Parent = player:WaitForChild("PlayerGui")Related APIs
Frame · TextLabel · StarterGui · PlayerGui