A
A
a16a2017-04-24 12:04:13
Unity
a16a, 2017-04-24 12:04:13

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

2 answer(s)
G
GavriKos, 2017-04-24
@a16a

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.

M
Mikhail Moor, 2017-05-05
@pasitiv

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 question

Ask a Question

731 491 924 answers to any question