Setting frames offset doesn't correctly align objects

I am creating an app list and I am trying to create a separate frame that is under a differnet parent but I want them to fully align on top of each other:

I’ve read some previous articles articles about grid layouts tampering with that but I didn’t know how valid that was and none of those topics posted solutions.

Here is the script:

--# NEW
		local canvasAbsoluteSize, canvasAbsolutePosition = appCanvas.AbsoluteSize, appCanvas.AbsolutePosition
		newAppFrame.Size = UDim2.fromOffset(canvasAbsoluteSize.X, canvasAbsoluteSize.Y)
		newAppFrame.Position = UDim2.fromOffset(canvasAbsolutePosition.X, canvasAbsolutePosition.Y)

Still need help with this, bumping!

what does it look like right now, and what do you want it to look like

Current:

Expected:


(The gray frame is over the contacts frame)

--# NEW
		local canvasAbsoluteSize, canvasPosition = appCanvas.AbsoluteSize, appCanvas.Position
		newAppFrame.Size = UDim2.fromOffset(canvasAbsoluteSize.X, canvasAbsoluteSize.Y)
		newAppFrame.Position = canvasPosition

Result:

They are parented to different things and they use scale for positioning.

Did you set a different AnchorPoint than 0, 0 for the frames?

1 Like

have you tried using a UIGridLayout object?

I have a plugin that sets everything at 0.5, 0.5 anchor point. I thought absolute position already took that into account, especially if I’m using offset instead of scale?

Not what the post is asking about, the base apps are already setup with a GridLayout, I need a way to create a frame under a different parent and have it at the same position, without using a GridLayout for it.

If all the frames are having same anchor point, this piece of code is supposed to work. Can you try running this code manually during run time to see if its some other issue? Also do you have any constraints under the frame?

1 Like

No constraints under anything.

image

Still experiencing this, what other issue could it be?

Its the anchor point, change it to 0,0 . Alternatively you could account for anchor point if you really need it to be .5,.5

1 Like

How would I account for the anchor point?

local Position = Canvas.AbsolutePosition + newFrame.AbsoluteSize * newFrame.AnchorPoint
newFrame.Position = Udim2.fromScale(Position.X , Position.Y)