I understand what absolute properties (AbsolutePosition, AbsoluteSize, AbsoluteRotation) are and how they are different from relative properties (Position, Size, Rotation) when it comes to reading pixel measurements based on the resolution of the screen.
I’m troubled with understanding when I would use them in a script versus their relative counterparts. Coming up with real examples of using them is part of the struggle.
An example that may or may not be correct I discovered is making a media query by changing the UI depending on the screen resolution size.
local f1 = script.Parent
f1:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
if f1.AbsoluteSize.X > 1500 and f1.AbsoluteSize.X < 1900 then
print("CHANGE THE UI")
end
end)
I’ve heard people use them to check for collisions between GUI objects and make accurate UI calculations through script, but I would like to see examples of how you’d use them.
What have you been able to make using absolute properties in your scripts/calculations?