Hello. How could i make a GUI maintain the position it had of the previous parent in Scale form?
I only care about the position not the size.
Example:
Not parented:
Parented:
Hello. How could i make a GUI maintain the position it had of the previous parent in Scale form?
I only care about the position not the size.
Example:
Not parented:
Parented:
I thing u are parenting to a Frame with a different Scale, create another Frame i name it FrameMain and make its Anchor Position to 0.5,0.5 and Position to 0.5,0,0.5,0, insert your two or more (all) Frames to the FrameMain
You can reference the UI Property AbsolutePosition.
It gives you the exact position via Pixels.
Store the AbsolutePosition before the GUI is moved.
Then move the UI, grab the new AbsolutePosition and get the distance difference which will give you a offset which you apply to the UI object.
The final value should be offsets not scale.
How do you make the final value be scales then? Even though i know how to convert it by screengui.AbsoluteSize it still doesnt work
Plus how about the size?
Nevermind just figured it out.
c.red.Parent = c.frame2
c.red = c.frame2.Red
local h = (curAbsRedPos - c.red.AbsolutePosition) / c.frame2.AbsoluteSize
c.red.Position = UDim2.new(h.X,0,1 + h.Y,0)
local siz = (curAbsRedSize - c.red.AbsoluteSize) / c.frame2.AbsoluteSize
c.red.Size = curRedSize + UDim2.new(siz.X,0,siz.Y,0)