What do you think the best way to "expand" a UI element is?

Hey developers!

I have a quick question for you; what is the best way to expand UI?

At the moment, out of laziness, my method is to put the frame I want to expand inside another frame with a UI list set to X center and Y center, then tweening the size of the frame - creating an expanding effect.

I understand that this is probably an inefficient way of doing this - does anyone do this differently? Is there a way to calculate the position (using scale) that the frame needs to be tweened to based on the size increase?

As always, thanks for your interest.

I just use a plugin to do the scaling for me, if you would like I can send you it.

Why not just tween the size of the frame alone? What’s the ‘other frame’ idea for?

https://gyazo.com/40a01260f878b82e50ea74e404b4ac50

The idea is to have the frame stay in the same position (not position value but rather the same visible position) while exapanding.

You can use an anchor point to retain the frame’s relative position to it’s size. From there, you can simply tween only the size property of the GUI element and it should retain its position (giving an expanding effect).

4 Likes

Revolutionary. So much better than what I was doing :joy:. Thanks a bunch.

1 Like