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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity UI Accurate Constant Physical Size canvas scaler for iphone SE

Discussion in 'UGUI & TextMesh Pro' started by ross_unity, Jan 4, 2018.

  1. ross_unity

    ross_unity

    Joined:
    Oct 19, 2017
    Posts:
    7
    I am creating a mobile game where I want to have a ui that is scaled based on physical size. For this I am using a canvas scaler that is set to "constant physical size" using Physical Units : Points, Fallback Screen DPI : 96 Default Sprite DPI 96 and reference Pixels per unit : 100

    upload_2018-1-4_14-25-17.png

    Then to ensure the UI is correctly organized for the IPhone SE screen I created a game view "Iphone5 wide" with resolution 568x320 per the documentation at https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

    However the UI scale shown in the editor is different that what gets rendered on an iphone 5
    Here is the view in the editor :
    upload_2018-1-4_15-26-44.png

    On the actual device :
    upload_2018-1-4_15-30-12.png

    Interestingly the buttons are the same physical size between the editor and device but the editor view is simply the wrong size. I'm assuming this is due to a difference in DPI between my monitor and the device.

    I must be using the canvas scaler incorrectly. I want to have the ui components to maintain the same physical size regardless of the devices DPI or resolution.
     

    Attached Files:

  2. ross_unity

    ross_unity

    Joined:
    Oct 19, 2017
    Posts:
    7
  3. Ghopper21

    Ghopper21

    Joined:
    Aug 24, 2012
    Posts:
    170
    Thanks ross -- it's really surprising that "constant physical size" doesn't work as expected... I thought I was going crazy until I saw your post here.
     
  4. JuanGuzmanH

    JuanGuzmanH

    Joined:
    Feb 8, 2018
    Posts:
    71
    Its annoying. 4 years later... and we are in the same situation.

    That's true. Constant physical size is not behaving as expected.

    It would be perfect to be able to design touchable interfaces and ensure a minimum space for fingers but, I abandoned this idea some time ago expecting this to be fixed in some moment.

    Maybe a solution is to have a minimum and maximum limits for scale like this feature proposal.

    https://feedback.unity3d.com/sugges...stant-physical-size-mode-of-the-canvas-scaler

    Please vote for it or propose another solution if you feel like.