So I have a UI setup with 4 canvases (top, left, right, bottom panels) and I’m struggling to get the panel on the right to scale properly from 16:9 ratio and 4:3. The top and bottom canvases use these settings:
They work great.
The right canvas also currently uses those settings, however, there’s one issue.
But if I use full height scaling instead of full width, the opposite happens: the panel shift wrong in 4:3 ratio compared to 16:9 and the text works well.
Any idea on how to scale this so both the text and panel adapt to 4:3 appropriately?
It’s not entirely clear how to help you, for two main reasons.
Why you are using 4 canvases (and there extents) are not known, nor how they are constrained, anchored and scaled to/with one another such that Canvases would stretch to fill the screen’s varying aspect ratios.
The screenshot’s arrows make it a little difficult to ascertain the issue which (I’m guessing) is the right column of text being somewhat vertically centralised in the 4:3 aspect ratio, as opposed to at the top in the 16:9 aspect ratio.
Without some insight into how you’ve built the setup, and why it might be behaving in this way, it’s impossible to comment on what’s going on, and how to remedy it.
If I was to guess, out of the blue sky, I’d say that the text object in the right canvas is not correctly set in its canvas, and that the canvases are behaving correctly, just this text object needs a bit of attention to get it to stay at the top, regardless of the height of the canvas it’s within.
Fair point. Here, let me make it more clear:
each panel is its own canvas (orange boxes). All panels anchored to the edge (left panel anchored to left side, top to top etc). All objects on the panels are set to centered. All canvases are scaled with the settings shown above (except the left panel, it scales with just height instead of width, but it works just fine. I guess because it’s smaller, the inaccuracies are negligible.)
And yes, the issue is that the text on the right panel shifts, and I’m not sure if there is a solution to fixing that without just writing a script to move each element on that panel.
Oh my god, you are right! I feel like I tried all sorts of things, but didn’t specifically try this. I am both facepalming and happy at the same time. Thanks for your guidance!
My pleasure. I’m sorry you had to wait a couple of days. I looked at this when you first posted it, but couldn’t figure out what was going on/wrong, and thought it would be rude and extra stupid of me to ask, as it might be obvious to someone else.
I eventually caved in, to see if I could figure out what I was missing from your images. To see if it was me → cause it usually is me that’s failing to understand something. I’m very glad it was something simple. This is what I’m always doing, too. Stupid little oversights. Lots and lots of them.
Combined with a passionate hatred for programming culture’s failure to take language seriously
Yea mate it happens to the best of us sometimes. If I get stuck and start spinning in circles it helps to have someone else take a peek and view it in a different light!