PlayerGui
A container that holds a player's UI.
| Memory category | Instances |
|---|
Member index 7
Description
The PlayerGui container stores objects that create the player's GUI. If a
ScreenGui is a descendant of PlayerGui, any GuiObject inside
that ScreenGui displays on 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. If
StarterGui.ResetPlayerGuiOnSpawn is set to true, all the contents of
a player's PlayerGui are cleared and replaced with the contents of
StarterGui every time the player's character respawns.
Note that if Players.CharacterAutoLoads is set to false, the
character won't spawn and StarterGui contents won't copy over until
Player:LoadCharacterAsync() is called.
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 32
- 698 Add
- 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 7
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