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

Location of UI element changes its appearance.

Discussion in 'UGUI & TextMesh Pro' started by hey_m8, Dec 8, 2016.

  1. hey_m8

    hey_m8

    Joined:
    Apr 15, 2015
    Posts:
    10
    UIBUGS123.png
    UII2.png

    I created a .png with white edges and a transparent body which acts as a border for all my UI elements, but I've noticed that the border of each element seems to vary in regards to edge thickness. See attachments for an examples.

    As I move an element around the screen, the entire border seems to change (notice in the attachments how the top edge has a different thickness). These are just simple UI elements on a Screen Space Canvas.

    The .png when opened up in any program clearly has evenly sized border edges, so this is something happening with Unity.

    Thanks.
     
  2. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    I'm guessing you're testing this in the Editor - your editor window is probably not matching the pixel size of your selected resolution - hence it's not able to draw the real object's size.

    Resizing the editor's scene/game window may yield different results.
     
  3. hey_m8

    hey_m8

    Joined:
    Apr 15, 2015
    Posts:
    10

    Thanks for the response. Yeah I was doing that in the editor, and when I build it to my phone the UI elements seem to behave normally I think. However, I have in-world 2D sprites as well which still exhibit the same problem. As you can see in the picture, the 3 squares all have different edge thickness seemingly because of where they are positioned in the world. It's subtle, but notice how the top square's top edge is thicker than the other two and how the middle square's bottom edge is thicker than the other two.

    It's not a huge deal, but I am curious about it.

    (Maybe now I need to move this to the 2D section ... I'm not sure)

    IMG_20161208_145805.jpg
     
  4. Izzy2000

    Izzy2000

    Joined:
    Dec 18, 2013
    Posts:
    49
    is or was there any scaling?
    maybe unity3d has pixel perfect which might help?

    so you can see sharp/crisp lines then: