PlayerGui
A container for a Player's currently rendered ScreenGuis.
Memory category | Instances |
---|
Member index 6
Description
The PlayerGui object is a container that holds a player's user GUI. If a ScreenGui is a descendant of a PlayerGui, then any GuiObject inside of the ScreenGui will be drawn to the player's screen. Any LocalScript will run as soon as it is inserted into a PlayerGui.
When a player first joins a game, 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 is cleared and replaced with the contents of StarterGui.
1 2 |
|
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 user'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 user, if the user is 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 |
SetTopbarTransparency sets the transparency of the Topbar 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. The current transparency can be retrieved using the similarly-named GetTopbarTransparency function.
Comparison of Values
The screenshots below show the topbar at 1.0, 0.5 and 0.0 transparency.
Usage
This method is often used when re-styling the topbar to match the visual aesthetic of a game. By hiding the topbar, you can create your own custom topbar. See the code samples for an example.
Alternative
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 topbar 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