Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Aspect ratio issue with iPad

Discussion in 'iOS and tvOS' started by bladerunner69008, Feb 9, 2021.

  1. bladerunner69008

    bladerunner69008

    Joined:
    May 2, 2019
    Posts:
    21
    I have a wargame développer for desktop and currently being ported to mobile


    The CanvasScaler is set to 1920x1080 with Screen matching 50% width / 50% height
    It works well on PC/Mac
    On iPhone, it is ok as the screen ratio is close to 16:9
    On iPad, the screen fits the 4:3 screen, whatever the settings on CavasScaler

    It is causing some distortion
    1. 2D Images tends to stretched in height
    2. The map , a hex-grid which in the 3D world, is also stretched. Camera is set to perspective

    Point 1 has bene handled by adapting the aspect ratio fitter with the device’s ratio

    Point 2 is more problematic. It anyone has the correct method to follow to manage this, he.she would be warmly welcomed


    I have also noticed that Screen.Width and Screen.height give the right measurement on start but quickly revert to 1920 and 1080, even without CanvasScaler. How come ?!



    Thanks in advance

    Cyril
     
  2. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    Did you have code anywhere that sets the rendering resolution via Screen.SetResolution?
     
  3. bladerunner69008

    bladerunner69008

    Joined:
    May 2, 2019
    Posts:
    21
    Indeed ! loading user preferred resolution.
    I can remove this as this makes sense only for desktop

    Let's test again... Bingo !!
    Thanks
     
    Last edited: Feb 10, 2021