Search Unity

Have problems with changing resolutions in Unity.

Discussion in 'General Graphics' started by DireBoarGames, Oct 16, 2019.

  1. DireBoarGames

    DireBoarGames

    Joined:
    Oct 16, 2019
    Posts:
    1
    Hello,
    I can't get expected results when changing resolution in game.
    I want a feature of changing resolution through game menu, not built-in Unity feature.

    The very changing of resolution was easy:

    Code (CSharp):
    1. Screen.SetResolution(1024, 768, FullScreenVar);
    FullScreenVar can be true or false depending if I want full screen.

    However, no matter what options I try, I still don't get exact result.
    What I want to do, is similar to what is done in other games.

    Option 1: The game is windowed.
    In this case, I want the game window to be of exact size of what I need.
    Like, if I want 1024x768, then the window be of this specific size.
    However, the window is usually larger, and there is the actual content, surrounding by blue frame.

    1.png

    After some googling, I also tried changing the aspect ratio, but it didn't make much changes.
    I also tried playing with settings in Unity itself, but got even weirder results: like the game screen only had a part of the content, as if everything was moved down, right or anything.

    So, question 1: what must I do, to make game window be "pure" without any borders around the content?

    Option 2: Game is full screen. In this case, the desired output is, well, full screen, with all the content resized. So, if the player chooses the said 1024x768, and his desktop resolution is 1600x900, the game content must be stretched to new size.

    Instead I get the same result of content in the middle, with empty surroundings.

    Question 2: in full screen mode, how do I stretch all images to full screen, if the chosen resolution is smaller?

    The third question is also about resolutions, but is slightly different.
    In Unity itself, I am working with default size of all screens 1600x900.
    However, one player complained, that he has set 1920x1080 (higher one), and it caused game buttons to be misplaced\resized.
    I haven't seen this, so can't say anything specific, but he said, that to change anything in options screen, he has to click not on buttons themselves, but somewhere in the vicinity.

    Question 3: Am I correct that it happened because actual resolution is higher then the default size of the screen in Unity itself? And if yes, how it can be fixed?

    ------

    How my game is organized.


    It uses just one main scene.
    The scene has camera and main game object named "areaContainer", which includes sub-game objects, which serve as game areas.
    Some of them are 1600x900, and some are 1508x700, since they also have UI.

    structure.png

    As I understand, the camera shows areaContainer.
    Here are their properties.


    properties.png

    Please help me with those issues.

    Thank you everyone in advance,
    Evgenie