I can confirm this is still an issue. The documentation doesn’t provide the fact that the AbsolutePosition property does not respect IgnoreGuiInset. The paragraph here does provide correct information in a scenario where IgnoreGuiInset would be respected:
For example, on a 1920 by 1080 screen, a Frame with position {0.5, 0}, {0.5, 0} would have an AbsolutePosition of (960, 540). If you were to place another Frame with position {0, 50}, {0, 50} inside that one, its AbsolutePosition would be (1010, 590). This example assumes each Frame has the default GuiObject.AnchorPoint of (0, 0), the top left corner.
But this is currently not the case. Here is a LocalScript I placed inside StarterPlayerScripts to prove this issue:
local Players = game:GetService("Players")
local GuiService = game:GetService("GuiService")
local playerGui = Players.LocalPlayer.PlayerGui
local screenGui = Instance.new("ScreenGui")
screenGui.IgnoreGuiInset = true
local Frame1 = Instance.new("Frame")
Frame1.Size = UDim2.fromOffset(100, 100)
Frame1.Position = UDim2.fromOffset(0, 0)
Frame1.Parent = screenGui
local Frame2 = Frame1:Clone()
Frame2.Position = UDim2.fromScale(0.5, 0.5)
Frame2.Parent = screenGui
screenGui.Parent = playerGui
print("Screen size:", screenGui.AbsoluteSize) -- Screen size: 1920, 1078
print("Gui Inset:", GuiService:GetGuiInset()) -- Gui Inset: 0, 36 0, 0
print()
print("Frame1 expected Position:", Vector2.zero) -- Frame1 expected Position: 0, 0
print("Frame1.AbsolutePosition:", Frame1.AbsolutePosition) -- Frame1.AbsolutePosition: 0, -36
print("Frame1 position difference:", Frame1.AbsolutePosition) -- Frame1 Position difference: 0, -36
print()
print("Frame2 expected Position:", screenGui.AbsoluteSize / 2) -- Frame2 expected Position: 960, 539
print("Frame2.AbsolutePosition:", Frame2.AbsolutePosition) -- Frame2.AbsolutePosition: 960, 503
print("Frame2 Position difference:",
Frame2.AbsolutePosition - screenGui.AbsoluteSize / 2) -- Frame2 Position difference: 0, -36
Here is also a place file:
AbsolutePosition IgnoreGuiInset.rbxl (41.7 KB)
Frame1 (which is at the exact top left of the screen), for example, should have the AbsolutePosition of 0, 0
, but this isn’t the case - its AbsolutePosition reads 0, -36
. It’s offset by the Gui Inset of 36 pixels.
The fact AbsolutePosition doesn’t respect IgnoreGuiInset
isn’t that impactful of an issue for me, as I was able to work around it. But could the documentation get updated to reflect the fact that IgnoreGuiInset
isn’t followed?