I have to make 2 panels on the bottom of the UI. The bottom left panel needs to stay at a fixed square size regardless of the game window size. The bottom right panel needs to keep a fixed height but expand the width to fill all the space in between the bottom left panel and right of the game window.
This green panel should remain a constant sized square, while the blue panel needs to expand its width but not its height when the game window is resized.
I've tried separating them into two different canvas', and using a horizontal layout group, but I can't get what I'm looking for. The closest I've gotten is with a single canvas that doesn't scale (constant pixel size), and a horizontal layout group that has the blue panel at a maximum width for my display resolution. This leads to the blue panel just going off screen when the game window is downsized, but I need it to fit exactly to the window.
CodePudding user response:
Green:
Blue:
Canvas (notice Match set to 1):
I hope it gives the result you were looking for
CodePudding user response:
Adding to @slowikowskiarkadiusz answer, I was able to get my intended result by following all of these steps, except I used Constant Pixel Size for the canvas scaler. The anchor points of the blue panel allow it to still expand width, but constant pixel size kept the height constant.