Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Pixel perfect ui

Discussion in 'Accessibility' started by Michaeljackson6543, Jan 20, 2024.

  1. Michaeljackson6543

    Michaeljackson6543

    Joined:
    Nov 22, 2022
    Posts:
    5
    How do I make it so that in unity 3d, on the UI, the gui is pixel perfect and the pixles aren't misshaped when it is on non-interger resolutions like 1366x768, I want it so that the pixles will always stay as a square shape
     
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    709
    Hello, if you're talking about UI, and that you're using uGUI (the one with the Canvas), you'll need configure your Canvas Scaler to scale whichever way works for you. If you're using UI Toolkit, these settings will be in your Panel Settings.

    This is not accessibility related though, so I suggest posting in the appropriate Forums (uGUI / UI Toolkit) if you need additional help (with more details of how everything is configured in your project).

    Hope this helps!
     
  3. Michaeljackson6543

    Michaeljackson6543

    Joined:
    Nov 22, 2022
    Posts:
    5

    The thing is that when I change the canvas scale to the exact same resolution as it is in the game and then scale the images in the ui, the scale will always be a non interger number which causes the pixels to stretch out and I want it so that it will keep the square shaped pixel
     
  4. Kt-ay

    Kt-ay

    Joined:
    Jul 28, 2014
    Posts:
    22
    Set the value of Canvas Scaler to 1:1