Search Unity

Bug Height Issue Per Resolution

Discussion in 'UI Toolkit' started by MousePods, Mar 1, 2021.

  1. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Hi,

    I don't know if this is intended or not. I am assuming not, but I want to make sure before reporting a bug.

    1. On a resolution with a height of 1125, I set the height of my element to 1125. It doesn't take up the entire height of the screen.

    Screen Shot 2021-03-01 at 12.25.13 PM.png

    2. On my native resolution with height 2048, I set the height of my element to 2048. It does take up the entire height of the screen.

    Screen Shot 2021-03-01 at 12.25.35 PM.png

    If I use the scaling factor in code:
    Code (CSharp):
    1. Screen.height * scaleFactor + (Screen.height * percent);
    it will work with the 1125 but, of course, mess up the native resolution now.

    Is this really how its suppose to work where you have to determine if on native resolution vs non-native and use the scaling factor to set a height or is this not working correct?

    Thanks!