Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Scaling Screen Size causes pixels to not line up

Discussion in 'UGUI & TextMesh Pro' started by aaronmichaelfrost, Aug 15, 2021.

  1. aaronmichaelfrost

    aaronmichaelfrost

    Joined:
    Feb 4, 2021
    Posts:
    39
    Hi everyone,

    I've been running into a problem when I have two UnityEngine.UI.Image (s) that I need to line up so that the vertical edges are flush.

    The problem is that, based on changing the screen size, the pixels seem to shift left and right.

    This also happens to some of my smaller UI elements: for example, an oval appears to be a rectangle depending on the point on the screen it is at.

    I assume that this has something to do with canvas scaling (I use 1920x1080p scale by width).

    Can anyone offer some help or resources about this issue?

    Thanks,
    Aaron
     
  2. NevinAF

    NevinAF

    Joined:
    May 12, 2021
    Posts:
    36
    Have you tried setting the canvas to constant pixel size? There are a few different options for that problem under the canvas component
     
  3. aaronmichaelfrost

    aaronmichaelfrost

    Joined:
    Feb 4, 2021
    Posts:
    39
    Scaling to a constant pixel size would be fine but I would prefer to build the UI for any sort of resolution. What I need is some way to use vector graphics in unity but it seems like unity wants to scale things in some weird way that isnt quite accurate because things get offset from one another based on the size of the screen.