Search Unity

How to disable UI scaling?

Discussion in 'UGUI & TextMesh Pro' started by Mateix, Aug 22, 2014.

  1. Mateix

    Mateix

    Joined:
    Aug 15, 2014
    Posts:
    8
    In full screen or in the bigger resolution than in Unity scaled UI looks quite strange.
    Can I disable UI scaling?
     
    Last edited: Aug 23, 2014
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    We only scale if you have configured the UI to scale... so yes you can disable it by not using scaling in your content.
     
  3. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Or in other words: scaling on the UI layout only happens if you scale the anchor.
    Keeping the anchor (the "power flower" :D) snapped together will prevent any scaling from happening, as I understand. :)
     
    Tim-C likes this.
  4. Mateix

    Mateix

    Joined:
    Aug 15, 2014
    Posts:
    8
    When I use Render Mode Screen Space - Overlay, all is ok. However, I need to use Render Mode World Space.
     
    Last edited: Aug 23, 2014
  5. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
  6. Mateix

    Mateix

    Joined:
    Aug 15, 2014
    Posts:
    8
    I must use World Space or Screen Space - Camera render mode.

    Yes, I tried use every render mode, but everything is working only when I use Screen Space - Camera or World Space (then unfortunately in fullscreen, the screen looks like it was stretched).
     
    Last edited: Aug 23, 2014
  7. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Can you make a gif or a short movie showing what the problem is, I still don't quite understand what you are seeing.
     
  8. Mateix

    Mateix

    Joined:
    Aug 15, 2014
    Posts:
    8
    I would like to scaling UI as Screen Space - Overlay, when I use Screen Space - Camera or World Space.


    Film made using the example project for Unity 4.6 UI.
     
  9. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    I have the opposite question. How do you enable scaling?
     
  10. Mateix

    Mateix

    Joined:
    Aug 15, 2014
    Posts:
    8
    Ok, so how do I make to the GUI isn't scaling? Can you help?

    PS. Sorry for my English, and for my shorts answers. It's not my mother tounge and I'm still learning. I'm from Poland.
     
    Last edited: Aug 24, 2014
  11. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Hi Mateix,

    So you are seeing this behaviour because of how the scene is constructed (it was done like this on purpose). If you move the camera outside the canvas hierarchy it will behave differently.
     
  12. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Yes - I see the problem. Tim already answered before I had breakfast, though. ;)

    This is indeed by design. Also logical and correct behaviour.
    World space means that the GUI is "hanging" in actual 3D space with coordinates and rotation and everything. Your camera remains in the same distance to the GUI canvas. So no matter how much you scale your view - nothing is changeing there except the screen resolution. The distance between GUI and camera defines how large it is shown inside your view.

    Think of it like this: place your camera inside a 3D scene and place it in front of a cube object. No matter how much you are going to resize the screen - the cube will remain the same size. Just like your GUI in worldspace.

    In Screenspace the GUI is stuck to the camera like a 2D Scene. Here's the difference, though - thanks to the anchor ("power flower" - I'll keep using that term) youcan decide if (and how much) it will behave like a 2D scene. If you keep the anchor fixed the item won't scale. That's the case in the given scene.

    Read more on it in your Manual files that installed with the Beta (it's not online yet it seems).
    Click the blue Help book here:


    Also watch these:
    http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-canvas
    http://unity3d.com/learn/tutorials/modules/beginner/ui/rect-transform