- Home /
How to scale all sprites, gui buttons, texts, images, 3d objects proportional to the screen height
Can I set a single Unity config that make everything appear in proportion to the height of the screen? For example, something with y=10px in 400x300 developing screen appears with y=20px in 800x600 and 960x600, y=24px in 720p screen, y=36px in the 1920x1080 and even y=13 on a 499x391 windowed app? Is it simple to do? Or need a lot of scripts? How to do it with best performance (only necessary calculations and graphic proccess)? Thanks.
Notes: (1) No deformations, X-scale factor equal to Y-scale factor. For example, something {20x10} in 400x300 developing screen appears {40x20} in 800x600 and 960x600, {48x24} in 720p screen, {72x36} in the 1920x1080 and {26x13} on a 499x391 windowed app. (2) Good scale quality, fix text character size on screen, mipmap on images, 3d textures etc. (3) Scenery, scene characters, etc. Not only user interface elements.
Answer by SahanD · Jan 07, 2019 at 08:30 AM
Select the Canvas in the Hierarchy tab and then go to inspector tab. > In the inspector tab goto Canvas Scaler choose "Scale with Screen Size" in UI Scale Mode and assign your development resolution in Reference Resolution (x,y) then change "Match" into 0.5.