Basically im trying to make a menu for the avatar editor in my game, and viewportframes are used to display items, but I need to be able to click on them.
Using hacky methods isn’t really reliable, so I was wondering if it was possible to put a ui button inside a viewportframe while it’s being affected by a UIGridLayout.
Any other methods would be great too.
Didn’t really know what to put this under so it’s just under scripting support
wouldn’t work, it’s a uigridlayout, everything is placed in a grid and even if I put the button outside the grid, I’d have no way to find the viewport’s position
Are you trying to say I need to make a frame for every viewport, because that would be a pain to do due to the fact it’s already inside a scrolling frame
You could parent the buttons to whatever GuiObject the ScrollingFrame is parented to, that way they wouldn’t abide to the formatting enforced by the “UIGridLayout” instance, this is albeit hacky.
no I couldn’t, there would be no way to position the buttons over the viewportframes, you can’t get the position of a gui object affected by a uigridlayout
If you’re positioning/sizing using the scale components of UDim2 values then you can use the “AbsoluteContentSize” property of the UIGridLayout instance (with a bit of math involved).
If you don’t want to go down that route then I suggest you create a backing frame (a container for the viewport frame and the button), this will work with the UIGridLayout.
sorry I didn’t originally read your question correctly, but this still wouldn’t have worked because the button wouldn’t appear overtop of the viewport, which is what needs to happen.