Dropdown Menu that automatically adjusts the UI Container

I am creating a UI that has a Container of objects, and each of those objects contains an optional Dropdown menu within it, that triggers via MouseClick.

I was able to replicate a basic dropdown adjustment, however, this also would cause the rest of the items in the container to adjust with it instead of the one object.

Refer to the images to see how I have it laid out.
image

The “Actions” Frame is the actual dropdown frame that tweens down or up after clicking the button.

Heres a video demonstrating the problem. As you can see, it moves all of the items via Padding, but I need to know if theres a better method of doing this.

If anyone knows a better method instead of using ListLayouts to create an auto-updating dropdown menu that only adjusts for the dropdown that was activated, as well as the others that may be activated after, please let me know.

I assumed this would be under ScriptingSupport as it is a scripting problem.

2 Likes

I wouldn’t edit the padding. Instead, try tweening the size of the parent Template Frame up, and either use an AspectRatioConstraint or tween the size of the elements inside down.

2 Likes

If your action frame is inside the template, then why not set the size of the template -= the size of the action frame when the action frame is invisible and then make the size of the template += the size of the action frame when it’s visible. This would automatically update the positions without a bug.

If this is already how you are doing this then I don’t know why it’s not working as it works for me, maybe it’s the way you are setting the size of the templates when they are visible and invinsible.

1 Like

Because I’m using a UIListLayout. It doesn’t automatically adjust according to the movement of the Action Frame, but rather does after I tween the Padding. Thus, causing the rest of the other items in the Container Frame to shift.

1 Like

Make the template frame transparency to 1 if you are using it as a background and make another fake background. Now set the size of the template to the total size without tweeting while tweeting the action button. This won’t make the other templates tween tho rather set the position I believe.

2 Likes

I appreciate you and @RoloTheDevBunny

Both of you gave me a great idea, and it worked. However I didn’t see your most recent reply until after I finished the solution, which was the exact same thing you replied with lol.

I simply changed it into this:
image

The UIAspectRatio made it easier to just ease the sizes with 1 tween rather than 4

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.