Search Unity

Issue with Screen Space - Overlay and Constant Physical Size

Discussion in 'UGUI & TextMesh Pro' started by matbrummitt, Nov 8, 2015.

  1. matbrummitt

    matbrummitt

    Joined:
    Jan 12, 2010
    Posts:
    107
    Hi all,

    I am having an issue with using Screen Space - Overlay with Canvas Scaler set to "Constant Physical Size".

    first, this is what I am trying to achieve:

    The issue:

    Prior to using Constant Physical Size everything appeared great in the editor, but testing on iPhone 6, parts of the UI were tiny in places because of the DPI I suppose, so I am now using constant physical size to make sure it looks the same on all devices. When changing to constant physics size, the scale of the canvas is automatically set (to 1.430556 in all axis in my case). My scrollview content is scaled at 1,1,1 and the child elements are being scale down to fit, by Unity.

    The trouble is, the spacing between my panels within "content" is based on the size of the children, prior to being scaled down. This causes alignment issues (see screenshot).

    If I instead, scale the "content" game object, and set my child elements to a scale of 1,1,1 I have no problem.

    I suppose my question is, how do I calculate the scale that Unity is automatically giving to the child elements of the "content" game object?

    It's hard to explain so please see the attached image which shows a few screenshots of the issue.

    Thanks

    Mat
     

    Attached Files: