Answer the question
In order to leave comments, you need to log in
How to set screen size in unity?
Hello.
How can I set the screen size. also the size of canvas elements?
When I export a program to android. and after installation I start, canvas and child elements float. How to fix it?
Is it impossible to do everything right in unity as it should, and then export it to an apk file?
Answer the question
In order to leave comments, you need to log in
Hang the CanvasScaler on the canvas. It has a reference resolution in certain Scale Modes. Next - everything is sorted out with anchors in UI elements - something to the left edge, something to the right.
In order for the elements not to float at different screen resolutions, you need to add the Aspect Ratio Fitter component to them and set the Aspect Mode values to either Width Controls Height or Height Controls Width, depending on how the screen will be located. If horizontal, then the first, if vertical, then the second.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question