I’m gonna keep this very simple and clear. I want to know how to position a frame beside a GuiObject that is within a UIGridLayout or UIListLayout like what is highlighted in red in the image below. I’ve looked around but haven’t found anything.
Sorry for the late reply. So I kinda have figured out that the issue is that when the size is set to scale, it changes within the button as u can see in this video.
I see. Try rescale the frame after parenting it to the button. I made a little test file so that you can experiment about with what I mean: Stat_Test.rbxl (57.2 KB)
Tell me if you encounter any issues.
I know I’ve marked this as a solution but I encountered a problem. So it seems that when I use ClipDescendents on a Scrolling Frame, it clips within that frame. I can’t set the ZIndexBehaviour to Global on the ScreenGui because it messes up all my other frames.
Well, if the ZIndexBehavior needs to be Sibling, I’d parent the Stats template to the GUI on creation and then I’d try to use AbsolutePosition and AbsoluteSize like so:
Of course, since this is all offset, afterwards I convert it back to scale. This guy explains it pretty well:
ViewportSize is a property of CurrentCamera. Since the template has a new parent, I needed to update some of the code. I converted the frame to Scale with this code:
local pos = obj.AbsolutePosition
local size = obj.AbsoluteSize
local abs_x = (pos.X+size.X)/viewport_size.X
local abs_y = pos.Y/viewport_size.Y
template_active.Position = UDim2.fromScale(abs_x,abs_y)
Code is pretty much rewritten. Here’s the place file containing the code if you want it: Stat_Test_Final.rbxl (57.3 KB)
This is exactly what I was looking for. I was trying to use the AbsolutePosition too but couldn’t figure out how to use it like this. Thanks a lot, I’ll mark this as the proper solution.