Search Unity

Overflow the visible area

Discussion in 'UI Toolkit' started by rogerdv, Nov 15, 2019.

  1. rogerdv

    rogerdv

    Joined:
    Jul 16, 2012
    Posts:
    90
    When I started adding stuff to my little dialog editor, I noticed that the visual elements are reduced to force them to fit in the window area. Of course, I would like to avoid this and I thought that a solution might be to put everything insider a scroll view. Is this correct, or there is some other mechanism to do it?
     
  2. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    377
    Hi rogerdv,

    It depends on what you want to do really. How do you want to manage the content that overflows? Do you actually want to scroll, how? Can you be more specific on what you want to achieve?
     
  3. rogerdv

    rogerdv

    Joined:
    Jul 16, 2012
    Posts:
    90
    Yes, I want to scroll vertically. Its a long list of NPC lines and player replies that wont fit in a awindow, it needs to be scrolled up and down.
     
  4. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    377
  5. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Specifically regarding the shrinking effect, that's because the
    flex-shrink
    property defaults to
    1
    which means elements will try to shrink to fit inside a container. Setting
    flex-shrink: 0;
    should fix the shrinking.

    If you do want to just scroll, use a
    ScrollView
    as the container.
     
  6. rogerdv

    rogerdv

    Joined:
    Jul 16, 2012
    Posts:
    90
    Thats what I did. I noticed that I could replace the container leemnt by an ScrollView and that fixed all problems. Besides, I put everything inside folds, so I can also reduce the parts Im not working to save space.
     
    uDamian likes this.