When I add a screen gui, and disable IgnoreGuiInset
, and set ScreenInsets
to CoreUISafeInsets
, then add a semi-transparent frame with position 0,0,0,0 and size 1,0,1,0, this is what I get:
You can see that the inset is a little bit further from the actual topbar’s visible space. This is not a huge issue, but whenever I get the position of the mouse cursor (which also considers GUI inset), the position for a Y height of 0 does not match the cutoff in the above screenshot.
This below is the position of the cursor when the Y is 0. (Y being LocalPlayer:GetMouse().Y
)
When I place my cursor where the GUI frame is starting, the Y position of the cursor is 36 (which is also the height of the old topbar if I recall correctly). This makes me think that this behavior is unintentional and is a bug of double-adding the old and new topbar offset to the GUI inset.
If this is intention, it is very unintuitive and is also different from previous behavior (in my game which involves aiming weapons, we use a custom cursor positioned at the mouse’s X and Y and for some reason it is broken here when it worked fine before).
In an older version of our code, this issue does not exist even though we use the new topbar as well (you can see that the semi transparent frame covers the correct part of the screen). The properties of the ScreenGUI and frame are identical across both tests.
Across both places, running the command print(game:GetService("GuiService").TopbarInset.Height)
outputs 58.
Expected behavior
I expect that the topbar inset behaves identically across both places, using the correct inset that accurately reflects the real size of the top bar as well as the Mouse’s X and Y positions.
A private message is associated with this bug report