I tried to search for “hide playergui”, to see if it was suggested before
As a Roblox developer, it is currently too hard to
Easily, immitate the same thing that the built-in Capture Button does, without interfering with other Enabled
states.
Image of the In-Experience Capture Button
If Roblox is able to address this issue, it would improve my development experience because
It would be easier and faster to hide and disable the rendering of the entire PlayerGui
. And for ScreenGui Containers even more.
“Captures APIs” was announced once
Reasons why Roblox doesn’t have to worry about hiding the PlayerGui
- The player has already full control of what can be put inside the
PlayerGui
and what not. - The PlayerGui is not the
CoreGui
- The In-Experience GUI is not being mounted on the PlayerGui, but instead into the
CoreGui
This probably explains why ScreenshotHud
, doesn’t hide the entire CoreGui
. Because a developer is able to enable the ScreenshotHud
and additionally move the buttons around.
This gives the impression that, Roblox doesn’t want any developer to control the In-Experience controls, to probably prevent any developer from soft-locking a user from going out of a game, to go back to the Universal App.
Which is understandable.
But that’s for the CoreGui
and not the PlayerGui
.
The linked thread, mentions CaptureService.CaptureBegan
and CaptureService.CaptureEnded
, however they don’t seem to trigger when using :CaptureScreenshot
, and are only specific to the In-Experience Capture Button.
Then there’s the mention of ScreenshotHud.HideCoreGuiForCaptures
and ScreenshotHud.HidePlayerGuiForCaptures
. Ironically, this only controls the behavior for the ScreenshotHud’s own Capture button and the In-Experience Capture Button.
It doesn’t actually do anything for :CaptureScreenshot
.
ToggleGuiIsVisibleForCaptures
Before a Capture is taken through the Roblox In-Experience Capture Button. GuiService:ToggleGuiIsVisibleForCaptures
actually gets called.
This can hide a GuiType
by running
game.GuiService:ToggleGuiIsVisibleForCaptures(Enum.GuiType.Custom)
Where Enum.GuiType.Custom
is referring to the PlayerGui
. This will toggle between rendering a specific Gui.
Here’s a summary of what I am thinking:
Image
I took it out of the collapse/expand
There’s also FFlagDebugAdornsDisabled
.
(more written below)
ScreenshotHud
You can run this, which will bring a ScreenshotHud
.
game.GuiService.ScreenshotHud.HideCoreGuiForCaptures = true
game.GuiService.ScreenshotHud.HidePlayerGuiForCaptures = true
game.GuiService.ScreenshotHud.Visible = true
If you click on the green Button, it will hide the PlayerGui
and some features of the CoreGui
. It won’t actually hide the rest of the CoreGui
, the Roblox Icon at the top left will still be visible, which is understandable.
Side Suggestion - ScreenGUI Containers, the better solution
If ScreenGUI Containers would be a thing, you could just toggle the Container off and all underlying ScreenGui would stop rendering, without interferring with other Enabled
states. Unfortunately, that’s not a thing.
This image showcases why ScreenGUI Containers would be beneficial. Separate ScreenGui prevent “x-ray clicking”.
And then, you could have like an “Interface” and make PlayerGui inherit from it, and now, you can hide PlayerGui and have new ScreenGui Containers!