Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How do I get the aspect to look like the one below?

Discussion in 'UGUI & TextMesh Pro' started by SoulEquinox, Feb 19, 2019.

  1. SoulEquinox

    SoulEquinox

    Joined:
    Jan 7, 2019
    Posts:
    2
    Hey guys,

    This my first post on the forum so go easy haha.

    Basically, like the title says I'm currently creating my IOS/Android first game (I have made it in 9:16 so far) and I want it to look good on iPhone and iPad size phones and tablets. I think the only way I can do this for the game I'm trying to create is to have the aspect attached to the bottom of the screen and then just remove part of the screen at the top as shown in the picture attached.

    My question is (since I'm majorly clueless when it comes to this) how do I achieve this? Will I have to use scripting?

    Also may be another stupid question but in general for IOS/Android games how small should my sprites be? I don't want the sprites to make the file massive when I build the game and I definitely don't want the edges to look jagged when I scale a large sprite down so can anyone provide clarity on what sort of sizes I should make the sprites in the editor?

    Thanks in advance guys,

    JJ
    Screenshot 2019-02-19 at 10.04.49.png
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    You can set the aspect ratio used when you build the game under Player Settings. Go to Edit -> Project Settings -> Player, then you can set the allowed aspect ratios under "Resolution and Presentation".

    You can set the aspect ratio you want to test with in the upper-left of the Game window using the second drop-down, which is probably set to "Free Aspect" by default. Once your game-window aspect ratio is set, the cameras in the scene will use that aspect ratio, which lets you can adjust the camera sizes and see how your camera will look at that aspect ratio and size in the Game Window.
     
  3. SoulEquinox

    SoulEquinox

    Joined:
    Jan 7, 2019
    Posts:
    2
    Hey thanks for getting back to me,

    I know I want to allow any aspect ratio but I want the screen to look like the picture attached rather than the picture stretching when someone uses an iPad. How do I do that?

    Thanks,

    JJ
     
  4. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Oh I see... you want to display the game in an aspect ratio smaller than the aspect ratio of the screen in a full-screen game?


    There are multiple ways to do it, I would do it with a RenderTexture and a background:

    - Create a renderTexture in your assets folder
    - set the resolution of the RenderTexture to the resolution you want your game to be
    - Set all cameras to render to that renderTexture

    - Create a new camera with a higher "depth" than your other cameras
    - Only render an unlit sprite or quad that has your renderTexture with the new camera
    - I recommend using a black clear color for this camera, but you can mess with the background if you want

    If you do this, you will have black bars around the 3:4 image to fill out the rest of the unused 9:16 space.