- Home /
How to make game screen responsive to different screen resolution?
This is the view of game for browser version ![alt text][1]
and now this is in mobile version![alt text][2]
Now how can I make my game resolution responsive to different screen resolution?
Thanks! [1]: /storage/temp/69119-browser.png [2]: /storage/temp/69120-mobile.png
You have to anchor or UI element and need to set scale with screen size. Here is 5 $$anonymous$$utes explatnion https://youtu.be/Sbbr$$anonymous$$6sN_ZE
Answer by ethansugar · Apr 30, 2016 at 06:05 PM
In your Canvas you'll add a Canvas Scaler Component. Then you will change the UI Scale Mode to Scale With Screen Size.
You have to put the Reference Resolution you work with, and then you have to change the Screen Match Mode to Shrink.
Try now adjusting the Game Scene Screen, or compile in your mobile.
I recommend change the Default Orientation to Landscape in the PlayerSettings (Edit>Project Settings> Player).
Answer by Nikunj-Kareliya · Apr 30, 2016 at 07:27 AM
You should keep landscape view for mobile platform instead of portrait view.
For UI alignment issues across the devices, You should learn Canvas Scaler, Rect Transform
More info:
Designing UI for Multiple Resolutions
Unity UI Tutorial - Scale UI to the right size for every resolution using anchors
I hope, it will help you.
Cheers.
Answer by bhuvanesh22 · Apr 30, 2016 at 11:36 AM
Check this out... for your resolution @JaamiParvez
private static float DeviceDependentScale
{
get
{
if ( Screen.width > Screen.height)
return Screen.height / 480f;
else
return Screen.width / 480f;
}
}
Answer by Katastrophe1986 · Apr 30, 2016 at 11:36 AM
The only thing I've seen so far has to deal with canvases, on the side there is a canvas scaler and you set that to scale with screen size.
Answer by hnrindani · Sep 08, 2016 at 11:32 AM
Aspect ratio plays an important role. The most common aspect ratios are 3:2, 4:3 & 16:9.
Adding this to your code will indicate a game to resize as per the screen sizes.
Your answer
Follow this Question
Related Questions
Adjust camera for different screen sizes 0 Answers
How to create and choose sprite sheet for different mobile screen resolution. 0 Answers
Why Is My Orthographic Camera Not Rendering at the Full Resolution? 1 Answer
Correct resolution/screen size for an A4 piece of paper 2 Answers
The infuriating Orthographic camera Vs Android Resolution. 2 Answers