Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

UI scale to integer sizes to match 2018.2's pixel perfect camera?

Discussion in 'Unity UI & TextMesh Pro' started by Zebbi, Jul 12, 2018.

  1. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    132
    I've gotten the pixel perfect camera script in 2018.2 to work, but on certain aspect-ratios or resolutions, my camera game area appears a lot smaller than the size of the screen with black bars around the edge to keep the pixels perfect. Is there a way of enforcing pixel perfection on the UI as well? Otherwise the UI resizes to match the screen size with a tiny game area in the middle of the screen on non-integer divisible screen sizes.
     
  2. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    140
    We have a sample scene here with a custom UI scaler script that might help you.
     
  3. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    132
    Thanks for that! So, it looks okay with some elements, but for instance, grid layout seems to be stretching very oddly with constant pixel size. Does constant pixel size have to be used in the custom scaler for the pixel-perfection to work? Do other elements in the canvas have to be set up in a specific way?
     
  4. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    132
    Does this custom scaler work on all of the settings or does it have to use constant pixel size?