PlayerGui
A container for a player's currently rendered ScreenGuis.
Memory category | Instances |
---|
Member index 6
Description
PlayerGui is a container that holds a player's UI. If a ScreenGui is a descendant, then any GuiObject inside of the ScreenGui will be drawn to the player's screen. Any LocalScript will also run if it is inserted into a PlayerGui.
When a player first joins the experience, their PlayerGui is
automatically inserted into their Player object. When the player's
Player.Character spawns for the first time, all of the contents of
StarterGui are automatically copied into the player's
PlayerGui. Note that if Players.CharacterAutoLoads is set to
false
, the character will not spawn and StarterGui contents will not
be copied until Player:LoadCharacter() is called. If
StarterGui.ResetPlayerGuiOnSpawn is set to true
, then every time the
player's character respawns, all of the contents of that player's
PlayerGui are cleared and replaced with the contents of
StarterGui.
If you need to control a player's UI container during playtime, for example to show/hide a specific ScreenGui or any of its children, access it as follows from a LocalScript:
1 2 3 4 |
|
History 31
- 573 Change ReturnType of SetTopbarTransparency from void to null
- 553 Change Default of SelectionImageObject from to
- 553 Change Default of ScreenOrientation from to LandscapeSensor
- 553 Change Default of CurrentScreenOrientation from to LandscapeLeft
- 486 Change ThreadSafety of SelectionImageObject from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ScreenOrientation from ReadOnly to ReadSafe
- 486 Change ThreadSafety of CurrentScreenOrientation from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TopbarTransparencyChangedSignal from to Unsafe
- 462 Change ThreadSafety of SetTopbarTransparency from to Unsafe
- 462 Change ThreadSafety of GetTopbarTransparency from to Unsafe
- 462 Change ThreadSafety of SelectionImageObject from to ReadOnly
- 462 Change ThreadSafety of ScreenOrientation from to ReadOnly
- 462 Change ThreadSafety of CurrentScreenOrientation from to ReadOnly
- 459 Change Tags of TopbarTransparencyChangedSignal from [] to [Deprecated]
- 459 Change Tags of SetTopbarTransparency from [] to [Deprecated]
- 459 Change Tags of GetTopbarTransparency from [] to [Deprecated]
- 458 Change Tags of TopbarTransparencyChangedSignal from [Deprecated] to []
- 458 Change Tags of SetTopbarTransparency from [Deprecated] to []
- 458 Change Tags of GetTopbarTransparency from [Deprecated] to []
- 459 Change Tags of TopbarTransparencyChangedSignal from [] to [Deprecated]
- 459 Change Tags of SetTopbarTransparency from [] to [Deprecated]
- 459 Change Tags of GetTopbarTransparency from [] to [Deprecated]
- 329 Change ValueType of SelectionImageObject from Object to GuiObject
- 290 Add ScreenOrientation
- 290 Add CurrentScreenOrientation
- 200 Add SelectionImageObject
- 191 Add TopbarTransparencyChangedSignal
- 191 Add SetTopbarTransparency
- 191 Add GetTopbarTransparency
- 55 Change Tags of PlayerGui from [preliminary, NotCreatable, PlayerReplicated] to [NotCreatable, PlayerReplicated]
- 47 Add PlayerGui
Members 6
CurrentScreenOrientation
Type | Default | |
---|---|---|
ScreenOrientation | LandscapeLeft |
Describes the player's current screen orientation.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 4
- 553 Change Default of CurrentScreenOrientation from to LandscapeLeft
- 486 Change ThreadSafety of CurrentScreenOrientation from ReadOnly to ReadSafe
- 462 Change ThreadSafety of CurrentScreenOrientation from to ReadOnly
- 290 Add CurrentScreenOrientation
GetTopbarTransparency
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
float |
Returns the transparency of the Topbar.
Thread safety | Unsafe |
---|
History 5
- 462 Change ThreadSafety of GetTopbarTransparency from to Unsafe
- 459 Change Tags of GetTopbarTransparency from [] to [Deprecated]
- 458 Change Tags of GetTopbarTransparency from [Deprecated] to []
- 459 Change Tags of GetTopbarTransparency from [] to [Deprecated]
- 191 Add GetTopbarTransparency
ScreenOrientation
Type | Default | |
---|---|---|
ScreenOrientation | LandscapeSensor |
Sets the preferred screen orientation mode for this player, if on a mobile device.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of ScreenOrientation from to LandscapeSensor
- 486 Change ThreadSafety of ScreenOrientation from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ScreenOrientation from to ReadOnly
- 290 Add ScreenOrientation
SelectionImageObject
Type | Default | |
---|---|---|
GuiObject |
Overrides the default selection adornment used for gamepads. For best results, this should point to a GuiObject.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 5
- 553 Change Default of SelectionImageObject from to
- 486 Change ThreadSafety of SelectionImageObject from ReadOnly to ReadSafe
- 462 Change ThreadSafety of SelectionImageObject from to ReadOnly
- 329 Change ValueType of SelectionImageObject from Object to GuiObject
- 200 Add SelectionImageObject
SetTopbarTransparency
Parameters (1) | ||
---|---|---|
transparency | float | |
Returns (1) | ||
null |
This method sets the transparency of the top bar CoreGui. A value
of 0
is completely opaque and a value of 1
is completely transparent.
Values outside of the range [0, 1]
are clamped. The default transparency
of the topbar is 0.5
.
Using the StarterGui:SetCore() method with the "TopbarEnabled"
option allows you to enable/disable the entire topbar and all of its
features (player list, health, etc). By contrast, this method only affects
how the top bar is displayed.
Thread safety | Unsafe |
---|
History 6
- 573 Change ReturnType of SetTopbarTransparency from void to null
- 462 Change ThreadSafety of SetTopbarTransparency from to Unsafe
- 459 Change Tags of SetTopbarTransparency from [] to [Deprecated]
- 458 Change Tags of SetTopbarTransparency from [Deprecated] to []
- 459 Change Tags of SetTopbarTransparency from [] to [Deprecated]
- 191 Add SetTopbarTransparency
TopbarTransparencyChangedSignal
Parameters (1) | |
---|---|
transparency | float |
Fires when the transparency of the Topbar CoreGui changes.
Thread safety | Unsafe |
---|
History 5
- 462 Change ThreadSafety of TopbarTransparencyChangedSignal from to Unsafe
- 459 Change Tags of TopbarTransparencyChangedSignal from [] to [Deprecated]
- 458 Change Tags of TopbarTransparencyChangedSignal from [Deprecated] to []
- 459 Change Tags of TopbarTransparencyChangedSignal from [] to [Deprecated]
- 191 Add TopbarTransparencyChangedSignal