How to keep Frame attached to edge when resizing CanvasGroup

Hello,

So I’ve been trying to size windows properly over the last few days (if that makes any sense) and I’ve come across an issue. I have a frame in a canvas group that won’t resize properly. It keeps going out of the screen or becomes too short and it is possible to see the stuff behind.

I want this whenever I scale it:


Not this:

In the second image, you can see that there is some white space at the bottom that won’t stay locked to the bottom of the CanvasGroup.

Any help is appreciated, and if you need more clarification on anything (as my explaining was a bit odd) I will be happy to do so!

Thank you,
Robyn

Ensure that you are using Scale and not Offset for all the relevant frames.

Yep I am using scale. It just does that and I have no clue why.

Are the black bars on the edge individual frames or is that the background?

Oh, my bad, the blue rectangle was just testing, and is just a frame inside of WindowContent.

If you want the blue rectangle to always have consistent padding on the edges, you have to make use of both scale and offset. For example, if you want the padding to be 50 pixels on each side, you can set the position to 0, 50, 0, 50 and the size to 1, -100, 1, -100.

Yes, but the WindowContent frame needs to be attached to the topbar, will that still work? (It’s also attached to the bottom, left, and right.)

I have no idea what that means. Can you please provide a diagram that shows what you want to achieve?

Yes, sorry.


I need the “WindowContent” frame to consistently stay underneath the top bar, (the gray bar with the text and three circles) and stay locked to the sides of the CanvasGroup, and bottom. (If that makes any sense)

Edit: I want it to consistently stay in that position, as well as act like this:

Edit 2: Nevermind, I got it working by modifying:

Thank you!

1 Like

Sorry, I’m still confused about what the problem is :sweat_smile:. I’d advise reading through this tutorial to see if it helps your case:

If it doesn’t help, a little more elaboration would be nice. It would help if you took screenshots of how your UI should look at varying screen sizes, as well as the current state of the UI so I can diagnose the issue and propose a solution. For example:

image

Read:

Your post has been marked as the solution.

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