Search Unity

Panel does not resize automatically in Canvas

Discussion in 'UGUI & TextMesh Pro' started by kosted, Jan 13, 2016.

  1. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
    Hi everebody, I have two panels in a canvas, and when I resize the screen passing from 16:9 to 16:10 for example, my two panels overlap. How could I do to keep the aspect ratio and resize also the panels automatically ?

    (Sorry for my bad English, i'm a french speaker)

    16:9
    16.PNG

    and 16:10

    10.PNG
     
  2. BinaryX

    BinaryX

    Joined:
    Aug 4, 2014
    Posts:
    55
    Try to set the "Canvas Scaler" ->" UI Scale Mode " to " Scale with Screen Size " see if that works
     
  3. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
    I already do that, to fit my canvas for all screens. But the panel does not change like any other
     
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    kosted:

    Did you already solve your issue? You have options;

    Parent/place anchor (non-split anchors) of each panel so that they have common anchor position, this way the won't overlap each other, but might go off screen from some edge, if you run out of space.

    Or split each panel's anchors to the edges of panels, and allow them to stretch, but you'll then have to see and solve how you want to handle contained buttons.
     
    kosted likes this.