Hi, I’m having some trouble putting in place an UI so I have a probably dumb question.
I’m using a canvas with the mode “Scale with Screen Size” with the Reference Resolution set at 800*600.
I put the Reference Pixels Per Unit at 100 which is the PU set on the sprite import settings.
With that in place, should I put the elements in place with a game window set at 800*600 ?
I’m guessing yes but I had a lot of trouble so I want to be sure I’m doing the right thing.
If not (or if you have good advices), how do you usually proceed to make your UI going well with every screen size ? Besides the anchors, what’s the importants things to consider ?
Anchors are really the most important thing. They represent how the UI element is laid out. Each UI Rect is laid out (positioned and scaled) relative to those anchors, each anchor corresponding to a corner of the UI Rect.
Check out these useful resources:
You should be able to change your Game View to almost any reasonable (or expected) resolution, and your UI should respond in a way that looks acceptable to you.
The first one is what I obtain with a low resolution like in the editor 427*240 whereas the second one (the good one) is what I get for a higher resolution (from 800 * 480) so I’m wondering if it’s because the low res shouldn’t exist and I can ignore it or if it’s a possibility that I’ve done something bad and it could reappear on someone’s phone ?