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. Dismiss Notice

New UI 4.6 scaling issue

Discussion in 'UGUI & TextMesh Pro' started by fivepointsevenn, Sep 14, 2014.

  1. fivepointsevenn

    fivepointsevenn

    Joined:
    Aug 20, 2014
    Posts:
    32
    Hey, folks. So, I'm playing around with new UI and here's the problem. When I resize the viewport, while keeping the aspect ratio, elements won't resize properly.
    Here's how I want it to look.


    Here how it looks, when I scale viewport up:



    AND it happens on iPhone screen when I resize viewport while using Unity Remote.

    What am i doing wrong?
     
  2. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    I don't understand what the problem is visually in your two images. They both look correct to me.
     
    rakkarage likes this.
  3. fivepointsevenn

    fivepointsevenn

    Joined:
    Aug 20, 2014
    Posts:
    32
    It might be hard to see on screenshots. On iPhone screen elements stay in their places but become smaller when i resize the viewport in Unity.
     
  4. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    Tried reference resolution on canvas?
     
  5. fivepointsevenn

    fivepointsevenn

    Joined:
    Aug 20, 2014
    Posts:
    32
    Just tried. It totally broke the layout. Canvas is "Screen Space - Camera" and some items have Z-offset for parallax effect when scrolling menu.
     
  6. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Make a test layout and use a reference resolution to see whether this would solve the issue.
     
  7. fivepointsevenn

    fivepointsevenn

    Joined:
    Aug 20, 2014
    Posts:
    32
    Yes, it fixed the issue.
    Thanks a lot.

    Have to rebuild entire layout, though:(
     
  8. fivepointsevenn

    fivepointsevenn

    Joined:
    Aug 20, 2014
    Posts:
    32
    Now there's another problem. When I change the aspect ratio to iPad or iPhone 4, some elements aren't anchoring and go off the screen.
     
  9. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
  10. fivepointsevenn

    fivepointsevenn

    Joined:
    Aug 20, 2014
    Posts:
    32