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

Canvas Scaler Constant Pixel Size not working on Android

Discussion in 'UGUI & TextMesh Pro' started by IntDev, Apr 8, 2015.

  1. IntDev

    IntDev

    Joined:
    Jan 14, 2013
    Posts:
    152
    I build my project to Webplayer (920x612) and when I put it in Fullscreen (1980x1080) the UI is fine, really in constant size.
    But, when I build the same project to my Android Tablet (resolution 2560x1600) all the UI get very tiny. I thought it should stay the same size as the Webplayer version.
     
  2. blizzy

    blizzy

    Joined:
    Apr 27, 2014
    Posts:
    775
    Are you perhaps confusing "constant pixel size" with "constant physical size"?
     
  3. IntDev

    IntDev

    Joined:
    Jan 14, 2013
    Posts:
    152
    Hmm... maybe, but "constant physical size" make UI assets a little bigger (hence blury), no matter if I change DPI or PixelsPerUnit values. What I'd like is to keep their original size in any screen size. The same is happening with my camera. I have a script that teorically should keep my game sprites in same size independently of resolution. On the Editor (no matter the resolution preview), webplayer (and fullscreen) it is correct, but on Android everything get tiny.

    Code (CSharp):
    1. camera.orthographicSize = Screen.height / pixelsToUnits * 0.5f;
     
    Last edited: Apr 9, 2015
  4. illustir

    illustir

    Joined:
    Dec 12, 2014
    Posts:
    24
    For me it's also not working on iOS and it's acting as if it is set to "Scale with Screen Size".
     
  5. ethentianknight

    ethentianknight

    Joined:
    Jan 5, 2016
    Posts:
    6
    I'd like to necromance this thread as a resolution wasn't found and I am running into the same issue.
    Setup:
    I have a canvas object with a canvas scaler set to 'scale with screen size', 800x600, match width, 100 reference pixels per unit.
    I create a button object and set its parent as the canvas object, which resizes it properly on my computer screen at different resolutions.

    However, I build and send to my phone and the button retains its original pixel size.
    This appears incredibly small as the phone's resolution is much greater than the screen I'm using.

    Any workaround available, or perhaps a reason that phones don't resize?
     
  6. wrensey

    wrensey

    Joined:
    Mar 12, 2017
    Posts:
    15
    Bringing this thread back to life again, have you found any solution for this?