Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug scrolllview problems

Discussion in 'UGUI & TextMesh Pro' started by JimWebs, Apr 21, 2024.

  1. JimWebs

    JimWebs

    Joined:
    Aug 2, 2023
    Posts:
    133
    This has to be the worst part of unity so far. Driving me batty. I got the scrollview working by pure fluke but changed something and now can't get it to work, even made a new one in new project to see what I was doing wrong and still won't work.

    I create scrollview. Remove bars. Remove the content component and add my own, an image. I put this in the correct place in scrollview, which needs the content object. Then I add a textmeshpro component to image. Then I set pivot on image, which in my case is the content part, to 0,1. It should snap into place at the top of the scrollview. It does ... now here's the buggy bit. In the past, if I add content size fitter at this point on the image (content) part, it will stay where it is in scrollview but work the way I want, resizing image to fit the text as I type it. However, now it just snaps out of place to the upper left of the scrollview out of view and doesn't work.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    8,396
  3. JimWebs

    JimWebs

    Joined:
    Aug 2, 2023
    Posts:
    133
    Every time maybe. It's just how my scatterbrain works. Besides there are too many subforums and subforums of subforums on here!!!
     
  4. JimWebs

    JimWebs

    Joined:
    Aug 2, 2023
    Posts:
    133
  5. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    8,396
    I don't. I haven't used uGUI in years now.
     
  6. JimWebs

    JimWebs

    Joined:
    Aug 2, 2023
    Posts:
    133
    Well I kind of got it working after messing about with it until my eyeballs bled. But still the text scrolls off on the right and doesn't stay within confines of dimension I've set unless I use line breaks "\n". If anyone can help with this part, appreciated.
     
  7. JimWebs

    JimWebs

    Joined:
    Aug 2, 2023
    Posts:
    133
    Okay almost got it back, text is now writing inside the confines of the image and stretching it to fit but only vertically. Horizontally the image stays at initial size and doesn't shrink or grow with text. !? God, this scrollrect in unity is crazy

    How do I get image to grow and shrink according to text size whilst still allowing text to stay within a confined limit horizontally? Doesn't seem any way to do it that I can see.