Search Unity

Distorted sprites in fullscreen mode

Discussion in '2D' started by neigaard, Jun 4, 2014.

  1. neigaard

    neigaard

    Joined:
    May 23, 2014
    Posts:
    24
    I am trying to get pixel perfect 2D on the screen and I have made a script that is attached to the scene that sets the orthographicSize of the main camera like this:

    Code (CSharp):
    1. void Start () {
    2.     float pixelToUnits = 100;
    3.     float cameraSize = (Screen.height / 2) / pixelToUnits;
    4.     Camera.main.orthographic = true;
    5.     Camera.main.orthographicSize = cameraSize;
    6. }
    If I run this in the editor it all looks good and it also looks good on my iPad, but in some resolutions (e.g. 800/600) my sprites gets stretched wider. I think this is because this resolution has a different aspect ration than my monitor (monitor native res is 1920x1200 that gives 1.6 and the resolution 800x600 gives 1.33), am I right?

    Is there a good way to fix this so my sprites never gets stretched in any resolution?